gnu-emacs-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

using local Wikipedia


From: Rick
Subject: using local Wikipedia
Date: Thu, 17 Jun 2004 19:11:00 -0400
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

I have a bit of a writeup on accessing a local Wikipedia
from emacs. See meta.wikipedia.org/wiki/User:MwZurp

Wikipedia (see wikipedia.org) is a user-created wiki-based
encyclopedia.

Here are some basic functions:

(defun wkp-get-article (title)
  (interactive "sArticle title:")
  (let ((id (string-to-int
             (wkp-select "cur_id"
                         (format "cur_namespace=0 AND cur_title='%s'"
                                 title)))))
    (wkp-select "cur_text" (format "cur_id=%d" id))))

(defun wkp-select (field condition)
  (shell-command-to-string
   (format "echo \"use wikidb;SELECT %s FROM cur WHERE %s;\" | %s | tail -1"
           field condition
           "mysql --user=wikiuser --password=wikipass")))

You have to have a local Wikipedia installed
in mySQL as "wikiuser" and with a password "wikipass".


reply via email to

[Prev in Thread] Current Thread [Next in Thread]