||[Nov. 24th, 2005|01:11 pm]
Hello there, I'm a software developer from Russia.|
I would like to write a server which allows LJ users access their friends' postings via NNTP (news gate). See bottom of the message for the technical problems I'm facing.
1. An LJ user connects to my NNTP gate and authenticates with his LJ username and password (in plaintext, but he may choose NNTP over SSL for security).
2. The login and password are not stored. They are immediately used by the gate to connect to LiveJournal and fetch the information that this user would see in his friends view, including protected entries. Comments to each entry are extracted, too. Of course, all this information is cached in the database of NNTP gate, and the gate also takes care of access levels, so as not to show to one user the cached protected entries that another user can see, but this one cannot.
3. Each entry in a friend's journal is presented by the NNTP gate as a message in a virtual newsgroup livejournal.username, where username is the name of the poster. The message has username@gatename in its From: header, where gatename is the domain name of the NNTP gate (I haven't yet picked one). Entries in the gate user's own journal are also presented in a similar virtual newsgroup for completeness. The Message-ID of such messages contains the LiveJournal entry ID.
4. Each comment in a friends's journal (or in the gate user's own journal) is also presented in the virtual newsgroup livejournal.username, where username is the name of the journal. The message has commentorname@gatename in its From: header. The Message-ID of such messages contains the LiveJournal entry ID and comment ID, and the message contains proper headers for reply-linking with other comment messages in this thread (LJ entry).
5. If the gate user wants to post or comment, he should connect to SMTP (optionally over SSL) and again authenticate with the LJ username and password. For posting, he should simply send a message to one of the livejournal.username newsgroup -- either to his own journal or a community. Some optional headers in the message can be used to specify posting options such as access level, userpic etc. For posting a comment, the actions are the same, but the gate checks for the In-reply-to header to find out that it's a comment and where it should be posted.
So, the main problem is: what is the best way to talk to LiveJournal?
1. How to extract the friends' entries? Currently I'm thinking of using RSS to download the latest entries from each of the friends' journals, but I'll be downloading much of duplicated information when only one entry has been added. Is this the best possible way? (I know that I can write a custom S2 style which presents the entire friends view as a single RSS feed, but then only paid LJ users would be able to use my gate.)
2. How to extract the comments? LiveJournal has a protocol for expoting comments, but it works only for the user's own journal. The protocol would be the best solution, but because it's unavailable for arbitrary journals, so it's the main problem that stops me from implementing my idea. Maybe if many people need this, comment exporing functionality for arbitrary journals can be added in LiveJournal?
3. How to post comments? LiveJournal has a great protocol for posting entries, but AFAIK there's no protocol for posting comments. Is it OK to simulate posting of comments through talkpost_do.bml?
Thank your in advance for your time.