npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

livejournal

v0.1.2

Published

LiveJournal API

Downloads

35

Readme

LiveJournal API

Build Status

npm install livejournal

This package provides access to both XMLRPC and JSONRPC APIs for LiveJournal.

XMLRPC

  • http://wh.lj.ru/s2/developers/f/LiveJournal_XML-RPC_Specification_(EN).pdf
  • http://www.livejournal.com/doc/server/ljp.csp.xml-rpc.protocol.html

Examples

// get posts inside the journal using XMLRPC
LiveJournal.xmlrpc.getevents({
  journal: 'brad',
  auth_method: 'noauth',
  selecttype: 'lastn',
  howmany: 20
}, function(err, value) {
  console.log(value.events);
});
// get post content using XMLRPC
LiveJournal.xmlrpc.getevents({
  journal: 'brad',
  auth_method: 'noauth',
  selecttype: 'one',
  ditemid: '29215'
}, function(err, post) {
  console.log(post.events[0]);
});

JSONRPC

There is no official public description of LiveJournal JSON RPC methods, but you can check Site.rpc.public on http://livejournal.com. Because the data is stored on CDN, you can access the data from anywhere.

Those are current ones (badly documented, contributions are welcome):

discovery.author_posts
comment.get_thread

Get comments thread

Params:
journal -- Journal username
itemid -- Post id
latest.get_entries

Get latest posts

Params:
first_timepost
browse.get_posts
gifts.get_gifts_categories
gifts.get_all_gifts
homepage.get_categories
discovery.suggest
sitemessage.get_message
discovery.get_categories
browse.get_categories
writers_block.get_list
discovery.today
discovery.get_feed
discovery.get_item
homepage.get_rating
browse.get_communities

Examples

// get latest posts using JSONRPC
LiveJournal.jsonrpc.request('latest.get_entries', {
  first_timepost: 1435262400
}, function(err, res) {
  console.log(res.body.result.params.recent);
});
// get comments using JSONRPC
LiveJournal.jsonrpc.request('comment.get_thread', {
  journal: 'tema',
  itemid: '1987717'
}, function(err, res) {
  console.log(res.body.result.comments)
});

You can access method list using LiveJournal.jsonrpc.methods.

API

LiveJournal.API is wrapper around some resources provided at http://www.livejournal.com/bots/

Other docs and resources

  • http://www.livejournal.com/developer/
  • http://lj-dev.livejournal.com/
  • http://www.livejournal.com/bots/

Tests

npm install jasmine -g
npm test