Main Stories
Slash Boxes

Slash Open Source Project

Slashcode Log In

Log In

[ Create a new account ]

A bookmarklet for quick story submission

posted by Krow on 06:55 PM March 5th, 2002   Printer-friendly   Email story
This javascript bookmarklet makes it extremely easy for users to submit a story to a slash site when browsing the web.

<A HREF="javascript:dOc=window.document;open('http:// YOUR SITE/'+escape(dOc.title)+'&stor y='+escape(dOc.URL));void( 0 )">Submit Story to YOUR SITE</A>

You must replace the instances of "YOUR SITE" with your domain name.

Once they have added the bookmarklet to their browser (by either by right-clicking the link and saving it as a favorite/bookmark, or, in most browsers, dragging the link onto the link toolbar), the user can easily submit a story to the site just by clicking on the bookmarklet while visiting a relevant web page. Note that it snags the web page title for the subject and the URL for the story. The user must have javascript enabled for this to work.

As a site editor, I find myself using this all the time.


This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login
Loading... please wait.
  • That's a cool idea! I always wind up doing the highlight/paste multiple browser thing. Never got so much use out of the "windowshade" window manager feature before ;)

    -- [], proudly running Slash since 1/28/2002.

  • This was a great little tip! I don't know how many users from sites will actually use this but I know I will for my site.

    Submissions like this with a quick goodie or tip would be a great idea for a 'Hot Tip of The Month' contest. Maybe give away a copy of the book you guys wrote(btw got mine yesterday and really like it) or just the sheer coolness of being the winner would be sufficient.

    Anyways, great idea and thanks for the tip!
  • This one is a little more complicated, but not much. With a very small modification to the newrdf function in slashd, I was able to provide headline feeds for people unable to grok RSS.

    Check out [] for the details.

    Be aware however that the JavaScript and Netscape Sidebar files can get LOTS of hits. This is ok for my site because the user base is small.


    YASS: []

    • Nice, you should wrie up a doc on doing that for others.

      BTW 2.4 has a lot more support in it for restructing RSS that you capture via portald.

      You can't grep a dead tree.
      • Krow; have you guys thought about a tip of the month?

        It wouldn't have to be supplied by you guys as it could be reader submitted. (The few times I've hung out in #slash I've picked up a few great tips from you guys so I'd imagine you guys would probably have the best tips though...)

        Heck, this could be a plugin idea; reader votes on a 'story' (in this case topic 'tips & tricks') of the month (call the db and query top 5 by views or comments of topic X then poll or just have an editor pick from there) and it sits in a slasbox or just a link in the organisation box.

        Even if you guys don't give a prize for it I think it would still be cool and possibly inspire more tips to be submitted. These days the recognition alone may be a help for the cs students in the groups fluff file.

        Anyways, I know it is easier to say 'hey do this or that' than to actually do it but maybe some one else may take the idea and run with it.
      • I should document this correctly, but here goes:

        This all applies to Slash 1.0.11.

        The newrdf subroutine in slashd is responsible for writing the section rdf files. Using the same information going out to the rdf file, I write 2 more files for each section - one for Netscape sidebars and one which is JavaScript.

        Netscape Sidebar

        This one is easy, just write a stand-alone html document with your story data. Mine is in the form of a slash box, but it could be any valid HTML doc. The only trick is that all HREF's need to point to the "_content" window (ie. target="_content" in each HREF).

        The JavaScript code to automatically place your sidebar in Netscape is available from their website (sidebar customize), or you could look at mine here [] (view source).


        We can use very rudimentary JavaScript to get our HTML into a user's HTML doc dynamically using JavaScript's doc.write() function. The doc.write() function is a print statement right in the middle of the user's HTML doc. Therefore, put your story data in HTML form in a series of doc.write() commands. Only write the meat of the HTML (eg. table structure) - don't put the <HTML>, etc.

        The JavaScript code the user needs to include in his HTML file is available on my site here [].


        YASS: []

    • I like this one too. I am not 100% clear on how to implement this one though. I'll have to view the source on your site and mess with it.

      This is a cool hack. I appreciate seeing these posted. Hopefully I'll have some to share with you guys in the future. For now I'll have to leach them from here.