-
Notifications
You must be signed in to change notification settings - Fork 0
/
lj.py
executable file
·33 lines (22 loc) · 917 Bytes
/
lj.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /usr/bin/python
# -*- coding: utf-8 -*-
'''this file is a sandbox for my experiments with differrent methods
of the LiveJournal protocol. Though I include this file in the distribution
it should rather be used as an example... Misha'''
from livejournal import LiveJournal, Config
config = Config ()
config.load ('~/.ljrc')
server = config.server
lj = LiveJournal (config.misc.version)
from pprint import pprint
pprint (lj.login (server.username, server.password))
if 0:
pprint (lj.checkfriends (lastupdate = '2002-07-24 00:00:00', mask = 1))
elif 0:
pprint (lj.getfriends (includefriendof = 1, includegroups = 1))
else:
print 'Synchronizing...'
value = lj.syncitems ()
print 'Got information for %d out of %d item(s)' % (value.count, value.total)
for item in value.syncitems:
print '%s (%s, %s) -- %s (%s)' % (item.item, item.itemid, item.type, item.time, item.action)