Wikipedia:Bots/Requests for approval/zanderhackbot

zanderhackbot

[[User:zanderhackbot|zanderhackbot]]

{{Newbot|zanderhackbot}}

Operator: {{User|Zanderhack}}

Automatic or Manually assisted:

Automatic

Programming language(s):

Ruby

Source code available:

See below

Function overview:

Performs a query to determine whether a wikipedia page exists or not. I need this so I can a hyperlinks to my website that go to real pages.

Links to relevant discussions (where appropriate):

N/A

Edit period(s):

One time run

Estimated number of pages affected:

no editing. it's just a check to see if a page with a given name exists

Exclusion compliant (Y/N):

N

Already has a bot flag (Y/N):

N

Function details:

checks to see if a page exists :

puts "http://en.wikipedia.org/w/api.php?action=query&titles=#{link.content.gsub(/ /,'_')}&format=xml"

wiki = Nokogiri::XML(open("http://en.wikipedia.org/w/api.php?action=query&titles=#{link.content.gsub(/ /,'_')}&format=xml", 'UserAgent'=>'Ruby Page Finder by Martin Szyllo, Morango London, martin@morango.co.uk Phone +44 020 7099-8959').read)

w = wiki.xpath('//api/query/pages/page')

if !w.attribute("missing")

puts "

=Discussion=

Could you confirm the the User_Agent details are OK please ?

What is the purpose of this bot? βcommand 01:15, 22 February 2010 (UTC)

There are various APIs that are more appropriate to query for existence than a HTTP page load; see http://www.mediawiki.org/wiki/API:Query_-_Properties#info_.2F_in and http://www.mediawiki.org/wiki/API:Query_-_Lists#allpages_.2F_ap Josh Parris 01:25, 22 February 2010 (UTC)

Yes , I want to query the names of several thousand geographical points of interest against the wikipedia titles to see if there is an equivalent wikipedia page for each one.

http://en.wikipedia.org/w/api.php?action=query&titles=stone_henge

It is too much work to run this many queries manually (from a browser), I need a robot to run this search thousands of times. Please advise how I should do this please ?

{{BotExpired}} —  HELLKNOWZ  ▎TALK 11:54, 10 March 2011 (UTC)

:The above discussion is preserved as an archive of the debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA.