dreamwidth-api-js
A simple Javascript client for Dreamwidth's XML-RPC API.
- Uses native Promises (transpiled for ES5)
- Additional helper functions to be added
Usage
Install on npm:
npm install dreamwidth-api-js
Or download the library and include:
var Dreamwidth = ;
Login
Login to your Dreamwidth account (note: you are required to login to access the API)
var myDreamwidth = Dreamwidth;
Methods
Use the general .method(value, options)
function to access API methods. See wiki documentation for a list of available methods and their options, in conjunction with the original Livejournal docs (note that both are a bit outdated)
Example: use 'getevents' method to get the latest posts from your journal.
// Set relevant options for the methodvar options = selecttype: 'lastn' howmany: 10 myDreamwidthmethod'getevents' options ;
Response:
events: eventtime: '2017-02-13 16:53:00' event: 'The post body content' anum: 456 itemid: 1 logtime: '2017-03-13 05:53:13' props: Object subject: 'The post subject' url: 'https://your_name.dreamwidth.org/123.html' // More entries...
To-Do
Helper functions for common methods, documentation.