Revision history for BookmarkManagerImportScripts


Revision [18938]

Last edited on 2008-01-28 00:13:24 by BrianKoontz [Modified links pointing to docs server]

No Differences

Revision [15102]

Edited on 2006-08-10 00:26:45 by BrianKoontz [Added import script for Firefox]
Additions:
===Firefox import===
- Parses a Firefox-generated bookmarks.html file into output suitable for processing by importDelirious.pl (see below). This is a very crude script that creates tags from the title and description text (but not keywords). It could stand some refinement, but it got the job done for me (over 400+ Firefox bookmarks).
Usage: parseFirefox.pl > myLinks.txt; importDelirious.pl myLinks.txt
##parseFirefox.pl##
# $Id: parseFirefox.pl,v 1.1 2006/08/10 04:21:13 brian Exp brian $
# parseFirefox.pl - Parses a Firefox bookmarks.html file
# Please note that this does not parse the Keywords field, nor does it
# preserve date/time stamps. It is probably not suitable for
# everyone without further modification, but it will get the basic job
# done of migrating bookmarks from Firefox to BookmarkManager.
# Usage: parseFirefox.pl > myLinks.txt; importDelirious.pl
my $dict = build_dict();
@nodes = $tree->look_down("_tag","a");
$link = $node->extract_links();
# Create taglist
my @rawterms = split(/[^A-Za-z0-9]\s*/, $title);
push(@rawterms, split(/[^A-Za-z0-9]\s*/, $desc));
@rawterms = map { lc $_ } @rawterms;
my @terms = grep { filter_terms($_, $dict) } @rawterms;
my $tags = join(' ', @terms);
print "Tags: $tags";

}
sub filter_terms() {
my($term, $dict) = @_;
$term = lc($term);
if( exists $dict->{$term} ||
$term !~ /^[a-z0-9]+$/ ) {
return 0;
return $term;
sub build_dict() {
# Source: http://www.andreas.com/faq-thousandwords.html
my $common_words =
"the, to, of, a, I, and, is, in, that, it, for, you, on, be, have, are,
with, not, this, or, as, was, but, at, in, from, by, an, if, they,
about, would, can, one, my, will, all, do, has, like, there, me, out,
your, what, which, some, so, we, more, who, any, up, get, am, if,
just, he, no, other, people, know, only, their, than, this, it, think,
when, them, been, time, had, were, and, note, his, should, use, then,
also, good, how, could, way, very, into, much, make, because, these,
see, may, as, even, you, two, want, most, new, many, well, such,
really, first, same, those, our, now, say, work, being, used, too,
anyone, here, where, over, what, right, but, problem, did, something,
go, there, her, back, file, we, still, need, said, find, off, him,
after, point, before, take, us, going, they, might, since, never,
better, read, name, got, long, someone, she, why, last, few, all, my,
number, must, using, own, little, made, down, believe, he, so, while,
line, both, around, another, through, for, thing, without, case, also,
no, between, year, set, sure, probably, enough, different, least,
group, else, put, lot, direct, each, information, part, how, any,
question, old, real, course, anything, fact, when, best, call, end,
give, help, demand, at, is, come, called, person, either, under, run,
try, done, though, always, list, look, news, world, thought, far,
again, available, seen, quite, rather, to, less, life, one, day,
great, found, tell, women, every, ever, against, place, after,
general, having, mean, above, heard, thanks, doing, able, high, from,
next, state, change, book, now, talk, well, new, possible, please,
bad, seem, man, following, send, example, several, computer, reason,
that, trying, getting, true, feel, wrong, type, let, stuff, keep,
hard, left, idea, show, power, remember, looking, why, until, game,
local, ago, others, car, are, actually, three, four, five, six, seven,
eight, nine, ten, yet, message, away, machine, interested, kind,
large, sun, already, order, small, government, space, free, running,
first, second, third, fourth, fifth, however, money, nothing, home,
level, music, start, issue, men, an, whether, given, test, user, big,
pretty, address, once, agree, area, include, write, mind, experience,
memory, original, of, discussion, word, god, understand, matter, not,
during, play, standard, making, hand, copy, whole, do, human,
interesting, just, cannot, yes, often, disk, side, maybe, these, nice,
came, public, some, source, dave, guess, hourly, open, almost, full,
buy, important, response, ask, return, simply, mark, went, hope, told,
tried, wanted, story, process, saying, form, another, love, couple,
law, answer, live, city, since, working, country, sort, major,
everyone, cost, care, word, usually, company, water, reading,
actually, instead, job, written, size, or, single, sense, pay,
language, short, lines, then, question, certainly, later, anyone,
note, speed, saw, similar, week, can, light, friend, certain,
difference, including, myself, response, hear, within, however, add,
correct, science, become, text, center, top, asked, error, known,
perhaps, consider, sound, easy, price, started, especially, rights,
stop, rest, everything, talking, local, recently, whatever,
particular, half, low, simple, define, network, subject, except,
provide, class, fine, check, woman, took, interest, along, she, turn,
due, clear, close, past, children, by, phone, argument, various,
result, although, opinion, worth, mode, together, mine, night, cause,
common, effect, position, maybe, head, likely, itself, situation,
unless, special, move, window, leave, allow, box, anyway, yes, sent,
personal, self, mentioned, claim, taken, record, future, function,
child, because, field, exactly, longer, view, four, most, happen,
expect, room, changed, front, today, rate, business, recent, with,
movie, main, needed, screen, wrote, anyway, early, product, issue,
performance, your, lost, anybody, page, looks, amount, house, who,
first, wish, gun, root, market, statement, necessary, fun, design,
month, thinking, date, history, happened, state, soon, break, death,
card, legal, choice, evidence, minute, war, body, taking, even, idea,
yourself, perhaps, release, involved, format, useful, although,
writing, chance, while, black, assume, upon, kill, received, required,
playing, output, week, cup, air, radio, willing, change, near,
complete, here, reasons, played, vote, present, related, tv,
political, quality, currently, environment, string, learn, paper,
color, hold, advance, fast, force, cut, considered, sometimes,
difficult, outside, album, save, specific, completely, doubt, food,
folk, total, site, show, normal, directly, white, among, coming,
family, religion, supposed, solution, culture, dead, development,
reasonable, create, decided, appropriate, knowledge, behind, exist,
suggest, buffer, science, action, entire, below, has";
my %dict = map { $_, 1 } split(/,\s*/, $common_words);
return \%dict;


Revision [15088]

The oldest known version of this page was created on 2006-08-08 15:53:25 by BrianKoontz [Added import script for Firefox]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki