Querying Wikipedia Web API



Here are the two example queries I'm attempting (in app I use JSON for the output data, but this helps with formatting):


Forced fail: Gibberish


Attempting: Stack Overflow


Running this does pull back data, and I know that the area I'm looking for is in jObject["query"]["pages"]. So I noticed that in a failure, the page name/property/whatever is "-1" and querying something valid gives you unique ID for that topic.


This is the code I currently have:


JObject excerpt = JObject.Parse(reader.ReadToEnd());
if ((string) excerpt["query"]["pages"] == "-1")
return null;
result.

Related to : Querying Wikipedia Web API
querying multiple results from MediaWiki / Wikipedia using Android or Java
Programming Languages

I am currently using MediaWiki's URL example to query HTTP GET requests on android.


I am simply getting information through a URL like this;


http://en.wikipedia.org/w/api.php?format=xml&action=query&titles=Main%20Page&prop=revisions&rvprop=content

However, in this example, I always need some sort of direct title and only get one result back (titles=some name here)


I know that Wikipedia has more complex search methods explained here;
http://en.wikipedia.org/wiki/Help:Searching


I would like to offer a few "previews" of multiple wikipedia article per search,

Querying Wikipedia Web API
Programming Languages

Here are the two example queries I'm attempting (in app I use JSON for the output data, but this helps with formatting):


Forced fail: Gibberish


Attempting: Stack Overflow


Running this does pull back data, and I know that the area I'm looking for is in jObject["query"]["pages"]. So I noticed that in a failure, the page name/property/whatever is "-1" and querying something valid gives you unique ID for that topic.


This is the code I currently have:


JObject excerpt = JObject.Parse(reader.ReadToEnd());
if ((string) excerpt["query"]["pages"] == "-1")
return null;
result.
How do I use the Wikipedia API
Programming Languages

I want try to get tennis players description from wikipedia without scratch the DOM page on a player x. It's not allowed and very boring. So, I hope someone can reply to my only question.


What can I do precisly with the Wikipedia API ? Can I get informations about a collection of tennis players easily ? or this API is not working for this. If not, I need someone tells me what is the purpose of this API because I don't understand the documentation.


Wikipedia API
Programming Languages
At the moment, Ive got this:
PHP Code:
<?
  $url = "http://en.wikipedia.org/w/api.php?"
        ."action=query&"
        ."list=exturlusage&"
        ."format=xml&"
        ."euquery=www.fender.com";
          
  // Get raw data
  $response = file_g
Querying Wikipedia
Programming Languages
Hi all,
I need to query wikipedia in PHP, and display only a part of the returned Website.
Suggestions/sample code are welcome.
Thanks,
Ruben
Querying a remote web API vs local MySQL DB during a traffic spike?
Programming Languages

We're implementing some code on our homepage that depends on a geoip lookup for every unique vistor and we have a choice of querying a geoip web service (Maxmind) or downloading the database and querying it locally. The server is currently a 512MB Linode instance and only receives around 1500 uniques per day however we are concerned what will happen during a traffic spike.

It's clear to me that the local lookup would be faster but surely under load hitting the database would be a lot more ram/CPU intensive than processing an additional http request. Obviously upgrading the servers memory is easily achieved if going local is the best route.I would imagine that over a certain number of connections per second, the server would be more likely to become unavailable querying its local database than a web api (assuming of course that the web api servers can handle the http requests).

Any input on which solution would be the most robust long term solution to handle the occasional traffic flood without any denial of service would be greatly appreciated.

EDIT: Just to try quantify this a bit further, lets say the server would need to be able to handle up to 200 connections per second. Each connection requires a single DB query or http request.



Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .