by nevermore · 13y ago · 0 comments
If you just want a bash script to look things up on wikipedia, you can always use something like
function wp { curl "http://en.wikipedia.org/wiki/$(echo "$@" | tr ' ' '_')" | gunzip | html2text }
which will work for basic queries (needs url encoding and words to be properly capitalized).
A full api reference is here (http://en.wikipedia.org/w/api.php).
Thanks for bringing this to my attention. I've added a disclaimer to the GitHub page regarding Pywikipediabot and plan to make changes to fully comply with MediaWiki API etiquette. The last thing I'd want to do is inadvertently cause problems for the site or foundation.
The wikipedia data is hosted here: https://bigquery.cloud.google.com/table/publicdata:samples.w...
Here is a sample query, searching for all articles that start with Positive:
SELECT id,title FROM [publicdata:samples.wikipedia] WHERE (REGEXP_MATCH(title,r'^Positive*')) LIMIT 10
Query complete (2.0s elapsed, 9.13 GB processed
1| 464347| Positive airway pressure
2| 10008223| Positive behavior support
3| 464347| Positive airway pressure
4| 1354851| Positivism in Poland
5| 1023857| Positive set theory
6| 5154273| Positivism dispute
7| 2871407| Positivism
8| 17179765| Positive psychological capital
9| 9033239| Positive Action Group
10| 4163012| Positive K
Here is the python API documentation: https://developers.google.com/api-client-library/python/