Subscribers Can Now Use SOAP for Slashdot Journals
Awhile back I added a SOAP interface for Slash journals. It lets you post journal entries, modify existing entries, delete entries, get entries for a specific user, and get individual entries.
I also implemented a perl distribution called Slash-Client to make it nice and easy to use. The base class, Slash::Client, defines the methods for the SOAP calls, including authentication. Slash::Client::Journal implements the specific journal methods.
There's two basic ways to authenticate, using a UID and password, or a logtoken (which can optionally be read straight from your browser's cookie file). So, as a quick example:
I've been using Slash-Client to post pretty much all my own journal entries (including this one) for months now: I just type into BBEdit, the first line is the subject, the rest is the body, and I Select All and hit a key combo to run the script to send it. It's worked well for me. I wrote a small Pudge::Journal class which calls Pudge::NowPlaying to put the fancy Now Playing link at the bottom, and off it goes.
Let me know if you have any questions.
I also implemented a perl distribution called Slash-Client to make it nice and easy to use. The base class, Slash::Client, defines the methods for the SOAP calls, including authentication. Slash::Client::Journal implements the specific journal methods.
There's two basic ways to authenticate, using a UID and password, or a logtoken (which can optionally be read straight from your browser's cookie file). So, as a quick example:
use Slash::Client::Journal;Reskeys (those things that are replacing formkeys, that don't let you abuse our resources) apply, so you can't just spam us with a bunch of journal entries and so on with SOAP any more than you could with the web interface.
# cookie file found automatically for Firefox on Mac OS X,
# so auth done automatically (patches welcome for others)
my $journal = Slash::Client::Journal->new({
host => 'slashdot.org',
ssl => 1,
});
my $id = $journal->add_entry({
subject => 'w00t',
body => 'this is the coolest thing EVAR'
});
my $get = $journal->get_entry($id);
I've been using Slash-Client to post pretty much all my own journal entries (including this one) for months now: I just type into BBEdit, the first line is the subject, the rest is the body, and I Select All and hit a key combo to run the script to send it. It's worked well for me. I wrote a small Pudge::Journal class which calls Pudge::NowPlaying to put the fancy Now Playing link at the bottom, and off it goes.
Let me know if you have any questions.
Now Playing: Wolfgang Amadeus Mozart - Serenade No.9 in D
Leave a comment