PS Birch (yagaysgs) wrote in lj_everywhere,
PS Birch
yagaysgs
lj_everywhere

Livejournal Searching Utility v1.2-Pub

Hallo all,

As promised, here's the util I wrote to do fulltext searches of your livejournal installs.


Livejournal Searching Utility v1.2-Pub 2/23/05
by Peter Sanderson, et al
http://www.yaga-ysgs.com/python/livejournal/ljsearch/


Disclaimer:
The files released here were written by Peter Sanderson for the livejournal
server installation at The Pittsburgh Supercomputer Center. In no way will
he or the PSC be liable for any damages caused by its use. It is distributed
free of charge under the general licenses "Don't Make Money Off Of Other
People's Work" and "If You Like It, Feel Free To Send Beer," and the request
to give credit to the author and his sources should you use the code.

Origins:
As most everyone knows, there is no built in functionality in the lj server
to do fulltext searches. Many in the lj_everywhere community have bemoaned
this fact, especially since we have our lj servers behind firewalls where
the likes of Google, Altavista, and Lycos can't see it. Seeking to rectify
this situation, I poked around and found a php script written by Kevin Phillips
of robohouse.com, got my bearings, and ploughed ahead.

Description:
The ljsearch.html utility allows for fulltext searching on livejournal entries
via the ljquery.py back-end. It is written entirely in python. It provides
the following functionality:
- Searching the entire depth of a user's journal
- Searching the journals of an entire livejournal db
- Searching a user's subject and/or entry text
- Searching with or without regard to case
- String, Boolean OR, or Boolean AND matching
- Sorting results by username or by data
- Formatting of results

Consists of four files:
- This readme.txt
- ljsearch.html
Python script that should be placed in LJHOME/cgi-bin
- ljquery.py
Python script that should be placed in LJHOME/cgi-bin
- ljminisearch.html
A single line version of the submit form

Requirements:
1) These scripts require python 2.0 or greater
To discover if you have python installed on your server,
type 'which python' on the command line. Be sure that the
python path in both ljsearch.html and ljquery.py is then set
correctly. #!/usr/bin/python is the default
2) These scripts assume a lj database schema as presently exists.
Should lj ever change their db, a new version of this script
will appear at http://www.yaga-ysgs.com/python/livejournal/ljsearch
3) Within the scripts are the following variables, which must
be changed for each installation:
ljquery.py
DB_HOSTNAME The full path to connect to your lj db server, ie 'db.somesite.org'
DB_USER The name of the lj SQL user on your lj db serve, ie, 'lj'
DB_PASSWD The SQL passwd for that user, ie 'swordfish'
ljsearch.html
HOSTNAME The fullpath to connect to your lj server, ie, 'lj.somesite.org'
ljminisearch.html
HOSTNAME The fullpath to connect to your lj server, ie, 'lj.somesite.org'

Useful Trivia:
- You may, if you like, use the single line contained within ljminisearch.html to add a
searchbox to your lj user pages. My suggestion would be to append the line to the
FRIENDS_RANGE_HISTORY=> and FRIENDS_RANGE_MOSTRECENT=> entries in your styles, as
contained in s1styles.dat. Similarly, I have also added a link to the html file in
both my Calendar and Friends views to make it easily accessible.
- I prefer Kalamazoo Brewing Company (Bell's), Victory, and Dogfish Head IPAs, though
ambers, browns, stouts, and pils are all very good

Contact:
Please feel free to contact lj@yaga-ysgs.com with any questions, including where to
send the beer
Subscribe
  • Post a new comment

    Error

    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded 

  • 0 comments