rone: (Default)
[personal profile] rone

The redoubtable Dave Zuckerman writes:

I'm not a huge blog fan.  Every once in a while, just to be contrarian, I think about doing periodic .plan updates, just so I can tell people who ask if I blog that they'll have to finger me to find out!  Bwahahahah!

Now i'm tempted to figure a way to stick my latest LJ entry into my .plan.

Date: 2004-01-15 07:01 am (UTC)
From: [identity profile] eviltofu.livejournal.com
Here is my python version.

---
import xmlrpclib,string,ftplib,os

ljUserName = "put your lj name here"
ljPassword = "put your lj password here"
tempFileName = "MyPlan"
fingerHost = "put the ip or hostname of the ftp site where you want to put your plan"
fingerUserName = "put the account name of the ftp account on the finger site"
fingerPassword = "put the password of the ftp account on the finger site"
fingerFile = ".plan"

server = xmlrpclib.ServerProxy(uri="http://www.livejournal.com/interface/xmlrpc",verbose=False)
result = {}
plan = ""

result = server.LJ.XMLRPC.getevents({"username": ljUserName,"password": ljPassword,"selecttype":"one","itemid":"-1"})
plan = string.join(
[ result['events'][0]['eventtime'],
result['events'][0]['subject'],
"",
result['events'][0]['event']],
"\n")

temp = file(tempFileName,"w+a")
temp.write(plan)
temp.close()

storeCommand = "STOR " + fingerFile

temp = file(tempFileName)
ftpClient = ftplib.FTP(fingerHost, fingerUserName, fingerPassword)
ftpClient.storlines(storeCommand,temp)
ftpClient.quit()
temp.close()

os.remove(tempFileName)
---

Simple no?

Profile

rone: (Default)
entombed in the shrine of zeroes and ones

December 2022

S M T W T F S
    123
45678910
11121314151617
18192021222324
252627282930 31

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 11th, 2026 06:31 am
Powered by Dreamwidth Studios