Tag all your old entries based on regexp patterns

Jun 29, 2005 23:34

Got hundreds of old entries, and don't feel like going through every single one of them to add tags? Discovered a cool new tag that you want to add, but don't want to look through lots of entries to figure out where to add it? Then look no further...

LJ Tagger will do it for you! )

Leave a comment

Comments 47

vanbeast July 1 2005, 04:11:34 UTC
Wow, that's freakin' awesome. I particularly like how you can tag by regex. Brilliant!

Reply


cparker July 1 2005, 04:30:49 UTC
That truly is nifty! Thank you!

Reply


aspiring2live July 1 2005, 04:59:26 UTC
Any chance this will ever be user friendly for non-code geeks like me? I mean, like a lame GUI or something that I can understand? PERL? don't have it, don't know where to get it or why I need it? See where I'm coming from?

(I can feel all those eyes rolling out there!)

Reply

z3bulin July 1 2005, 05:36:28 UTC
No no! I understand.

Perl? I'm sure I could figure it out...but the time... If there was an easier way, that would be keen.

Reply

threeleet July 1 2005, 05:39:00 UTC
Unfortunately, probably not- I'm mostly a web programmer, & have no GUI experience whatsoever. Even if I did try to hack a GUI onto it, it'd probably be in gtk-perl or something, and I don't really know if it's possible to package something like that into a downloadable bundle that'll work on all platforms. And even if I knew how to write something in a compiled language, I don't have a Windows box to compile that version on (and so far all but 1 of the downloads have been Windows).

Anyone else know a way to make a (GUI-fied or otherwise) perl script into a self-contained program?

Reply

satanicsocks July 1 2005, 07:14:36 UTC
Hmm, maybe use Mason to make a web UI out of it?

Reply


shatterstripes July 1 2005, 05:28:01 UTC
Woo. Very cool.

So it requires an exported copy of all your entries, and does the search on that, then connects to LJ to change the tags? I'm just wondering at the basic flow of it - if it grabs the tags list for an entry off of LJ, so I could run it multiple times with different tags, without having to re-export the whole history...

Reply

threeleet July 1 2005, 05:32:52 UTC
Basic flow is it searches through your local copy, if it finds a match & you say 'y', then it grabs the entry from the server (since the exports don't have the taglist), then sends it back with the updated taglist. If you want to add more than one tag to the same pattern, you could "trick" it into adding them all at once by setting the tag to something like 'tag1, tag2, tag3', since the taglist is just a comma-separated list anyway.

Reply


ydna July 1 2005, 07:01:16 UTC
Very nifty indeed. I tried bending it around the Xjournal1 local history file (an archive of all journal entries), but it's in Apple's plist format which makes it a little more... interesting. I got as far as,

--- ljtagger.pl.orig 2005-06-30 23:20:07.000000000 -0700
+++ ljtagger.pl 2005-06-30 23:39:17.000000000 -0700
@@ -170,6 +170,10 @@
$updated = 0;
grep_entry($entry);
}
+ } elsif ($data->{'dict'}) { # Xjournal's History.plist format
+ print "Xjournal History.plist format detected.\n\n" if ($USER->{'VERBOSE'});
+ $format = 'xjournal';
+ ...;
}
}
and said "Ick". The History.plist format looks like,

Years

Months

Days

DayNumber
22
Entries

Content
Hey, neato.
Date
2002-01-23T04:43 ( ... )

Reply


Leave a comment

Up