egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Wikipedia Quick Link

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
Gordon
Voice


Joined: 04 Apr 2007
Posts: 34

PostPosted: Sun Mar 02, 2008 8:40 am    Post subject: Wikipedia Quick Link Reply with quote

Quote:
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_archive.tcl?mode=download&id=1454

Code:
#========================================================================
# ** 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.)
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Mar 02, 2008 11:03 am    Post subject: Re: Wikipedia Quick Link Reply with quote

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 Razz) 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)]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber