This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Wikipedia Quick Link

Support & discussion of released scripts, and announcements of new releases.
Post Reply
G
Gordon
Voice
Posts: 35
Joined: Wed Apr 04, 2007 11:45 am

Wikipedia Quick Link

Post by Gordon »

Allows IRC users to link to Wikipedia quickly through the bot. The default format is: !wiki article name.
Download: http://www.egghelp.org/cgi-bin/tcl_arch ... ad&id=1454

Code: Select all

#========================================================================
# ** Wikipedia Quick Link
#========================================================================
# * Description:
#
#    * Allows IRC users to link to wikipedia quickly through the bot.
#    * The default format is:
#       !wiki article name
#
#------------------------------------------------------------------------
# * Features:
#
#    * Replaces spaces by underscores. Example:
#         Article Name
#      will become
#         Article_Name
#      in the link
#    * Changes first letter of the article to upper case. Example:
#         article
#      will become
#         Article
#      in the link
#    * Mentions which nickname requested the link to prevent confusion.
#
#========================================================================

# Calls the script when people say !wiki at the start of the line.
# Changes this to whatever you want to make the script call on other
#  keywords.
bind pub - "!wiki" spidey:wiki_link

# Two letter language of the wiki you want to link to.
set wiki_lang "en"

proc spidey:wiki_link { nick host hand chan text } {

	# Turn spaces into underscores
	set article [string map {" " _} $text]
	# Make sure article name starts with upper case letter
	set article [string toupper [string index $article 0]][string range $article 1 end]

	# If no article is entered...
	if { $article == "" } {
		# Make it the main page article
		set article "Main_Page"
	}
	# Print link
	putserv "PRIVMSG $chan :\00312\037http://$::wiki_lang.wikipedia.org/wiki/$article\037\003 (Requested by \002$nick\002)"
}

# Log the script as successfully loaded.
putlog "Wikipedia Quick Link 1.1 by Hen Asraf: Loaded"
There is problem with encoding. It cant work with special characters (foreign langs.)
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Re: Wikipedia Quick Link

Post by speechles »

Gordon wrote:There is problem with encoding. It cant work with special characters (foreign langs.)
Yep, that's because of the simplicity and lack of understanding for wikipedia this script has. It doesn't do much. If you want something for foreign wikipedia I highly suggest Unofficial Incith Google script (shameless self promotion :P) which includes a multi-language, kick-ass wikipedia/wikimedia parser which can actually display information from the wiki page, not just some dumb quicklink crap.
sample from irc wrote:<speechles> !wiki .fr Résultats
<sp33chy? Gestion par résultats | La gestion par résultats (ou GPR), ou axée sur les résultats (GAR), est un mode de gestion qui mise simultanément sur la qualité des services aux citoyens, l'optimisation des ressources disponibles et la conformité aux règles administratives. La GPR constitue aujourd'hui un cadre officiel de gestion pour plusieurs gouvernements. C'est le cas de la Loi sur l'administration
<sp33chy> publique au Québec, la Loi organique sur les lois des finances en France, la Loi générale sur la performance par les résultats (GPRA) au États-Unis...etc. Dans son approche générale, la GPR permet aux gestionnaires publics d'améliorer de manière continue les Résultats de leur organisation. Par résultats, Mazouz et Leclerc (2008) font réfé @ http://fr.wikipedia.org/wiki/Gestion_par_r%C3%A9sultats [1
<sp33chy> Redirect(s)]
Post Reply