dracodraconis: (Default)
2009-04-15 08:36 am

Quicklink submission seems stable

It appears the jerry-rigged solution works and doesn't require being logged into LJ. The final version of the code is below:

javascript:void((function(){var%20u='http://www.dreamwidth.org/',w=window.open('','','toolbar=0,resizable=1,scrollbars=1,status=1,width=1000,height=500');if(window.LJ_bookmarklet){return%20LJ_bookmarklet(w,u)};var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.onload=function(){LJ_bookmarklet(w,u)};e.setAttribute('src','http://www.livejournal.com/js/bookmarklet.js');document.getElementsByTagName('head').item(0).appendChild(e)})())

Create a bookmark in your browser and in the URL field cut-and-paste the above script. One of the biggest changes that is needed is to replace the http://www.livejournal.com/js/bookmarklet.js javascript code residing either locally or on a DW server rather than on the LJ server, but I'm leaving that for others who may be so inclined.

If anyone makes any improvements to this script, please let me know and I'll update this post with appropriate cudos.


[personal profile] jennifer, feel free to post a link to this post on [community profile] memewidth because I don't have posting access to that list.


dracodraconis: (Default)
2009-04-13 09:48 pm

Second attempt at one-click submission

This still requires the bookmarklet function on LJ, but appears to no longer require being logged into LJ or posting to it first. Once again, I'll give it a few days of testing to see what bugs appear. If this version appears stable I'll crosspost so people can at least start using it.

javascript:void((function(){var%20w=window.open('','','toolbar=0,resizable=1,scrollbars=1,status=1,width=1000,height=500');if(window.LJ_bookmarklet){return%20LJ_bookmarklet(w,'http://www.dreamwidth.org/')};var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.onload=function(){LJ_bookmarklet(w,'http://www.dreamwidth.org/')};e.setAttribute('src','http://www.livejournal.com/js/bookmarklet.js');document.getElementsByTagName('head').item(0).appendChild(e)})())

The change here is that the document source is set to be the script on the LJ server while the code is handed the dreamwidth URL.
dracodraconis: (Default)
2009-04-10 12:52 pm

Javascript for command-line posting

I just arrived at Dreamwidth yesterday and have, so far, been rather impressed. One of the features I missed, however, was the bookmarklet javascript for auto-posting. I've gerry-rigged the LJ javascript function to perform the same function for dreamwidth:


javascript:void((function(){var%20u='http://www.dreamwidth.org/',w=window.open('','','toolbar=0,resizable=1,scrollbars=1,status=1,width=1000,height=500');if(window.LJ_bookmarklet){return%20LJ_bookmarklet(w,u)};var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.onload=function(){LJ_bookmarklet(w,u)};e.setAttribute('src',u+'js/bookmarklet.js');document.getElementsByTagName('head').item(0).appendChild(e)})())


Create a bookmark in your browser and in the URL field cut-and-paste the above script. One of the biggest changes that is needed is to replace the http://www.livejournal.com/js/bookmarklet.js javascript code residing either locally or on a DW server rather than on the LJ server. I'll continue to play with this to see what I come up with.

If anyone makes any improvements to this script, please let me know and I'll update this post with appropriate cudos.

Edit:
Found a bug with the method; it only works if you have run the script to post to LJ at least once in this session. Not a big problem at the moment because I'm posting to both so I just post to LJ first, then to DW, but this is certainly not a long-term solution.

Edit 2: Now testing some locally-running javascript to attempt to perform the same function but so far no-go.