Anyway, here is a sample session with my post cataloging program and actual source of the program:
[localhost:~/Documents/perl/monks] metaperl% perl log-posts.pl url? http://www.perlmonks.org/index.pl?node_id=124633&lastnode_id= +126016 title? Re: Big Ball of Mud category (EOF to end)? design patterns category (EOF to end)? software engineering category (EOF to end)? monolithic programs category (EOF to end)? Inserting: node 124633 Title Re: Big Ball of Mud Categories design patterns, software engineering, monolithic prog +rams [localhost:~/Documents/perl/monks] metaperl%
So I want to create a database of all my posts, searchable and browseable by keyword. I know this has been discussed ad infinitum, but no one has come up with a useable mechanism for it.use strict; sub trim { $_[0] =~ s/^\s+//g; $_[0] =~ s/\s+$//g; } sub question { print "$_[0]? "; <>; } my $url = question 'url'; my ($node) = $url =~ /node_id=(\d+)/ ; my $title = question 'title'; trim $title; my @cat; while (my $cat = question 'category (EOF to end)') { trim $cat; chomp($cat); push @cat, $cat; } print "Inserting:\n"; print "node\t\t$node\n"; print "Title\t\t$title\n"; { local $"= ', '; print "Categories\t@cat\n"; }
The actual hook into this code can be via FTP, CGI or whatever else you guys suggest, but I need to get something off the ground for myself and I am sure you people do too.
In reply to posting catalog source with example by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |