coffee project advanced

I've been experimenting with a script to auto-build a GilesWatchers post from a set of tagged bookmarks. Results thus far are promising.

Here's my delicious account bookmarks list. Here's today's hand-built GilesWatchers post. My generated version:

+ ljs: The Shape of Things - Giles/Anya, FRM
+ kivrin: Top Five Teas in Giles' Tea Tin - gen, FRC
+ kivrin: untitled ficlet - Buffy/Giles/Willow/Xander, FRC

+ noelia_g: 249 Jossverse/Wesley icons - 9 of Giles
+ sharmen_88: 58 Jossverse icons - 3 of Giles
+ mangofandango: 50 Jossverse Icons - 2 of Giles

+ versaphile & psychoadept: Collateral Damage, part 83 - Giles/Wesley, FRAO
+ soft_princess: What Happens In Vegas... 2/2 - Giles/Xander, FRAO

+ Why We Fight - post-"Chosen" RPG is recruiting for all characters except Buffy

+ summer_of_giles: signups still open
+ slashthedrabble: Challenge #120 - Unexpected - this week's prompt
+ btvs_hush: Challenge 74 - images of Giles
+ maleslashminis: Round Eleven (Bonus) - signups open for a threesomes round

+ soft_princess: Giles/Xander story

Note that there are some intentional differences: the "rec" tag, for instance, which was an experiment. And some unintentional: I'll need to make a fixed order for the categories.

Yet to be implemented: some way to set a marker so we only catch recent posts. The api can set tags on bookmarks. I can fetch the most recent 100 bookmarks, skip the ones with the "posted" tag, then set the tag for the ones just posted. OR alternatively I could let the poster specify a date stamp and only grab bookmarks fresher than the stamp. Lots of options. Must think.

Some of the features ride on the back of clever tagging. "poster:ljuser" and "comm:community-name", for instance. But it handles missing lj names well. By its very nature, however, one link per entry. I can't think of a non-messy solution for multi-part stories that had more than one part posted at a time. Bleah. I can at least sort the posts by timestamp... Have I ever mentioned that every programming project is infinitely complex, at least in potential?

The advantage of this approach is that the accumulation of links can be gradual and can be done by more than one person. One person would be responsible for running the script and making the post. At the moment I run it in the shell; no reason it can't be run as a cgi script with a web interface.

I didn't spend all of my day off programming. Only a couple hours of it. And part of that was spent on the story server. I am beginning to look askance at Django.
  • Current Music: Driving To Heaven : Tiësto : Elements Of Life
That's really cool.

Sometimes I look at the things you program up and despair whether CompSci is actually the right thing for me to major in. Woe!
That was one hour of trivial work.
- Install the python delicious library. Read its tiny documentation. 10 minutes.
- Make a delicious account & bookmark the posts for today's Watchers. 5 minutes.
- Contemplate a tagging scheme. Tag bookmarks.
- Write a python script to exercise the delicious library api & fetch bookmarks. Do some trivial class design to hold tags & bookmarks, as returned by the API, and parse them into useful structures. 120 lines of code.
- Tinker with the output until it looked good.

Item 4 is the only one that took thought. Though I suppose #3 also implies a certain amount of contemplation of the problem space. All of this was fast because I have done some large projects in Python and know its libraries well. (Not that this problem exercised that knowledge...)

I took some CS classes in college (whee! data structures! numerical methods!) but had been programming for a while before then. I am self-taught in the main. You can be too, if you want. Especially if you're considering majoring in it. You should be programming now, on your own, avidly.

This is actually a decent little project for a first-time programmer. The library does the heavy lifting of implementing the delicious API for you. (Though a nice second project, very practical for today's world, would be implementing the API ibrary yourself.) Python is a nice first programming language-- doesn't force you into learning object-oriented concepts until you're ready for them, has a nice clean syntax. There are five Python tutorials for the non-programmer listed on the Python docs page.
Saturday's my next day off; I'll sit down and look at this stuff then and see if I can make heads or tails of it.

Thanks for the links! :)