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-14 03:59 pm (UTC)
From: [identity profile] lusercop.livejournal.com
Does anyone still use finger(1)?

I find I tend to log into machines and use w(1).

Date: 2004-01-14 04:07 pm (UTC)
From: [identity profile] wisn.livejournal.com
I was thinking, "Hey, isn't that what John Carmack was doing?" and googled and found http://www.webdog.org which archives .plan messages for a variety of software developers. For what it's worth, Carmack's last archived update was Jan 23 of last year, and finger johnc@idsoftware.com yields 'connection refused'.

Date: 2004-01-14 05:13 pm (UTC)
From: [identity profile] bivaughn.livejournal.com
I'll write you something in PHP if you want.

No problemo!

Date: 2004-01-14 06:37 pm (UTC)
From: [identity profile] fabio-heinz.livejournal.com
perl -MLWP::Simple -e 'getprint "http://www.livejournal.com/users/ronebofh"' > $HOME/.plan

HTH! HAND! SEND ME A DOLLAR!

Re: No problemo!

Date: 2004-01-14 07:08 pm (UTC)
From: [identity profile] tyggerjai.livejournal.com
"latest LJ entry".

While I'll grant that "the entire damn page" does indeed include "latest entry", I'm not sure this is what was meant :)

rone - what client do you use? the update.bml web page? Because a client side hack is easiest, but a cron post harvester should be easy enough using Simes' LJ::Simple.

sol.
.

Re: No problemo!

Date: 2004-01-14 07:36 pm (UTC)
From: [identity profile] tyggerjai.livejournal.com
Ah. rone is a paid user and therfore has the full article text inthe rss feed. So stripping the most recent article from the rss page is even easier than parsing the html page.
The serious way involves an XML parser - the easy way involves the LWP trick with the rss page and split() :)

But I'm not going to do it as an on-the-fly one liner :)

sol.
.

Re: No problemo!

Date: 2004-01-14 09:26 pm (UTC)
ext_8707: Taken in front of Carnegie Hall (evil)
From: [identity profile] ronebofh.livejournal.com
I am, actually, not a paid user.

Re: No problemo!

Date: 2004-01-14 09:34 pm (UTC)
From: [identity profile] tyggerjai.livejournal.com
Hm.

Then either LJ now includes the entire post in the rss description for everyone (it used to truncate unpaid users), or you have short posts :)

Seems they include the whole post for everyone. Oh huzzah.

If you're serious, consider it done - I have code for much of this at home, so given a weekend it should be doable.

sol.
.

Re: No problemo!

Date: 2004-01-14 10:11 pm (UTC)
ext_8707: Taken in front of Carnegie Hall (evil)
From: [identity profile] ronebofh.livejournal.com
You are a bad man to tempt me with such toylike trivialities.

Re: No problemo!

Date: 2004-01-14 10:19 pm (UTC)
From: [identity profile] tyggerjai.livejournal.com
I was going to say the same to you.

sol.
.

While you americans sleep ...

Date: 2004-01-15 02:38 am (UTC)
From: [identity profile] tyggerjai.livejournal.com
We antipodean munchkins toil to make you wondrous gifts. Behold:

9:35pm@kittling~...perl/rone>roneme -u ronebofh

_now there's an idea_

The redoubtable Dave Zuckerman (http://www.panix.com/~daz/) 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 (http://www.vetmed.auburn.edu/cgi-bin/finger?rone%40ennui.org).



===================================


Now for the *hard* cutting and pasting - stripping the HTML.

sol.
.

munch, munch

Date: 2004-01-15 03:15 am (UTC)
From: [identity profile] tyggerjai.livejournal.com
9:50pm@kittling~...perl/rone>roneme -t -u ronebofh

_now there's an idea_

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.


===================================


The formatting may need tweaking, but I'm sure you can pipe it to fmt before .planning it


Oh, and:
9:50pm@kittling~...perl/rone>roneme -t -i2 -u ronebofh

_now there's an idea_

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.


===================================

_blogulate_

Bob Mould has a Web log. His new stuff doesn't appeal to me,
unfortunately. Any comments from anyone out there who's a fan of his
old AND his new stuff?


===================================


You'll need:
#!/usr/bin/perl -w
use strict;
use LWP::UserAgent;
use Getopt::Std;
use XML::Simple;
use HTML::FormatText;


Which I consider pretty standard, but then I do this shit for a living.

Let me know your email address (I'm solitaire@tygger.net), and I'll let you know where to pick up the first cut. I'd like to polish it a little before I release it to the world at large.\

Though it's 77 lines of perl. I could just email it to you :)

sol.
.

Re: No problemo!

Date: 2004-01-14 08:00 pm (UTC)
From: [identity profile] fabio-heinz.livejournal.com
While I'll grant that "the entire damn page" does indeed include "latest entry", I'm not sure this is what was meant :)
Meh, changing specifications!
#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;

my $content = get("http://www.livejournal.com/users/ronebofh/");
local($/);

if ($content =~ m|<div class="entry">(.*?)</div>|ms)
{
my $latest_entry = $1;
#strip tags and crap
$latest_entry =~ s/<.*?>//g;
$latest_entry =~ s/&nbsp;/ /g;

open PLAN, ">$ENV{HOME}/.plan" or die "can't open .plan: $!";
print PLAN $latest_entry;
close PLAN or die "can't close .plan: $!";
}

__END__

Re: No problemo!

Date: 2004-01-14 08:25 pm (UTC)
From: [identity profile] tyggerjai.livejournal.com
Fragile :)
It breaks as soon as he changes layout/format. Or at least has the potential to break - some layouts don't even use the div.

Splitting the RSS feed is the way to go.

my $content = get("http://livejournal.com/users/ronebofh/rss");

Then split on "", chop off everything after , de-htmlise as you do, and you're good to go. Though I'd run it through HTML::Parser to expand the entities rather than trusting to  , and I'd use an XML parser anyway.

sol.
.

Re: No problemo!

Date: 2004-01-14 08:28 pm (UTC)
From: [identity profile] tyggerjai.livejournal.com
Fuck it :)

"split on <description>", and you want the second element of the array thus produced. Then discard everything after "</description>", etc.

I can't be expected to be thinking right, I'm at work!

sol.
.

Re: No problemo!

Date: 2004-01-14 09:26 pm (UTC)
ext_8707: Taken in front of Carnegie Hall (evil)
From: [identity profile] ronebofh.livejournal.com
I use Semagic on Windows and Logjam on FreeBSD.

Re: No problemo!

Date: 2004-01-14 09:36 pm (UTC)
From: [identity profile] tyggerjai.livejournal.com
Ah.
So a cronned or otherwise triggered screenscraper will in fact be easier than a client hack.

sol.
.

Date: 2004-01-14 11:52 pm (UTC)
From: [identity profile] eviltofu.livejournal.com
Can you run a python? If so that possibly I can hack an xml-rpc -> ftp script.

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?

Date: 2004-01-15 07:06 am (UTC)
From: [identity profile] eviltofu.livejournal.com
bah! I forgot to take into account how html would warp formatting and Python is formatting sensitive. Here is the URL to the python file.

http://home.earthlink.net/~eviltofu/ljfinger.py

Date: 2004-01-15 08:45 am (UTC)
From: [identity profile] fabio-heinz.livejournal.com
And that, ladies and gentlemen, is why I don't like Python. Significant whitespace SUCKS!

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. 5th, 2026 06:46 am
Powered by Dreamwidth Studios