I want to add a widget to a web page that will allow user to enter search terms and search wikimedia for images that match the terms. I have implemented a similar widget for flickr, using their API, but am having trouble doing the same with wikimedia.
Basically, I would like to replicate the functionality of the commons.wikimedia.org search page. Ideally I would like to be able to get a Category listing (ex. http://commons.wikimedia.org/wiki/Chartres_Cathedral) or a true search results (ex. http://commons.wikimedia.org/w/index.php?title=Special%3ASearch&search=%...), but at this point I would be happy with either.
I've tried using the allimages list, but that is not adequate. Is there any other way to search images using the API?
I have also been looking at Freebase and DBPedia. These seem like they might do what I want, but RDF is completely new to me and I'm still trying to figure out the basics of it. If anyone can point me in the right direction for either of those resources, I would appreciate it.
Regards.
Tim Helck
On Thu, Dec 29, 2011 at 10:21 PM, Timothy Helck timothy.helck@gmail.com wrote:
Basically, I would like to replicate the functionality of the commons.wikimedia.org search page. Ideally I would like to be able to get a Category listing (ex. http://commons.wikimedia.org/wiki/Chartres_Cathedral) or a true search results (ex. http://commons.wikimedia.org/w/index.php?title=Special%3ASearch&search=%...), but at this point I would be happy with either.
The search results are exposed through the API: https://commons.wikimedia.org/w/api.php?action=query&list=search&srs... . Unfortunately we don't really have image keywords or anything like that, so searching for images is not as simple as it probably should be. But it's probably been done before.
Roan
Roan,
I've looked at search, but it only seems to return names of pages, not images. Is there a way to make it return images?
Tim
On Fri, Dec 30, 2011 at 7:13 AM, Roan Kattouw roan.kattouw@gmail.comwrote:
On Thu, Dec 29, 2011 at 10:21 PM, Timothy Helck timothy.helck@gmail.com wrote:
Basically, I would like to replicate the functionality of the commons.wikimedia.org search page. Ideally I would like to be able to
get a
Category listing (ex.
http://commons.wikimedia.org/wiki/Chartres_Cathedral)
or a true search results (ex.
http://commons.wikimedia.org/w/index.php?title=Special%3ASearch&search=%... ),
but at this point I would be happy with either.
The search results are exposed through the API:
https://commons.wikimedia.org/w/api.php?action=query&list=search&srs... . Unfortunately we don't really have image keywords or anything like that, so searching for images is not as simple as it probably should be. But it's probably been done before.
Roan
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
On Fri, Dec 30, 2011 at 9:01 PM, Timothy Helck timothy.helck@gmail.com wrote:
Roan,
I've looked at search, but it only seems to return names of pages, not images. Is there a way to make it return images?
The regular search doesn't return images either, does it?
Roan
On 30/12/2011 20:05, Roan Kattouw wrote:
On Fri, Dec 30, 2011 at 9:01 PM, Timothy Helcktimothy.helck@gmail.com wrote:
Roan,
I've looked at search, but it only seems to return names of pages, not images. Is there a way to make it return images?
The regular search doesn't return images either, does it?
Roan
Google Image Search is your friend.... just curl/wget/get this....
https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=query_st...........
You will need a Google API key as well....
Gordo
On 30/12/11 21:01, Timothy Helck wrote:
Roan,
I've looked at search, but it only seems to return names of pages, not images. Is there a way to make it return images?
Tim
Files are at namespace 6, which wasn't included in the provided query: https://commons.wikimedia.org/w/api.php?action=query&list=search&srn...
Gentlemen,
Thanks for your previous suggestions.Unfortunately I've been busy with other things and I am just getting back to this.
I think I have found a reasonable strategy for searching images. I can use this query (siilar to what was suggested by Platonides): https://commons.wikimedia.org/w/api.php?action=query&list=search&srn...
Then I can parse the result set and create another query which gets me the urls: https://commons.wikimedia.org/w/api.php?action=query&titles=File:Chartre...
However, I am still encountering a problem -- commons.wikimedia.org doesn't like requests that don't come from a browser. When I put these queries into php I get a 403 error. Is there a url where I can search wikimedia programatically?
regards,
Tim
On Sun, Jan 1, 2012 at 3:51 PM, Platonides platonides@gmail.com wrote:
On 30/12/11 21:01, Timothy Helck wrote:
Roan,
I've looked at search, but it only seems to return names of pages, not images. Is there a way to make it return images?
Tim
Files are at namespace 6, which wasn't included in the provided query:
https://commons.wikimedia.org/w/api.php?action=query&list=search&srn...
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
On Thu, Mar 8, 2012 at 10:09 AM, Timothy Helck timothy.helck@gmail.com wrote:
Gentlemen,
Thanks for your previous suggestions.Unfortunately I've been busy with other things and I am just getting back to this.
I think I have found a reasonable strategy for searching images. I can use this query (siilar to what was suggested by Platonides): https://commons.wikimedia.org/w/api.php?action=query&list=search&srn...
Then I can parse the result set and create another query which gets me the urls: https://commons.wikimedia.org/w/api.php?action=query&titles=File:Chartre...
However, I am still encountering a problem -- commons.wikimedia.org doesn't like requests that don't come from a browser. When I put these queries into php I get a 403 error. Is there a url where I can search wikimedia programatically?
Please see http://meta.wikimedia.org/wiki/User-Agent_policy
regards,
Tim
On Sun, Jan 1, 2012 at 3:51 PM, Platonides platonides@gmail.com wrote:
On 30/12/11 21:01, Timothy Helck wrote:
Roan,
I've looked at search, but it only seems to return names of pages, not images. Is there a way to make it return images?
Tim
Files are at namespace 6, which wasn't included in the provided query:
https://commons.wikimedia.org/w/api.php?action=query&list=search&srn...
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
-Liangent
thanks!
On Thu, Mar 8, 2012 at 1:30 AM, Liangent liangent@gmail.com wrote:
On Thu, Mar 8, 2012 at 10:09 AM, Timothy Helck timothy.helck@gmail.com wrote:
Gentlemen,
Thanks for your previous suggestions.Unfortunately I've been busy with
other
things and I am just getting back to this.
I think I have found a reasonable strategy for searching images. I can
use
this query (siilar to what was suggested by Platonides):
https://commons.wikimedia.org/w/api.php?action=query&list=search&srn...
Then I can parse the result set and create another query which gets me
the
urls:
https://commons.wikimedia.org/w/api.php?action=query&titles=File:Chartre...https://commons.wikimedia.org/w/api.php?action=query&titles=File:Chartres%20cathedral%202881.jpg%7CFile:Chartres%20cathedral%202880.jpg%7CFile:Chartres%20cathedral%202879.jpg&prop=imageinfo&iiprop=url
However, I am still encountering a problem -- commons.wikimedia.orgdoesn't like requests that don't come from a browser. When I put these queries
into
php I get a 403 error. Is there a url where I can search wikimedia programatically?
Please see http://meta.wikimedia.org/wiki/User-Agent_policy
regards,
Tim
On Sun, Jan 1, 2012 at 3:51 PM, Platonides platonides@gmail.com wrote:
On 30/12/11 21:01, Timothy Helck wrote:
Roan,
I've looked at search, but it only seems to return names of pages, not images. Is there a way to make it return images?
Tim
Files are at namespace 6, which wasn't included in the provided query:
https://commons.wikimedia.org/w/api.php?action=query&list=search&srn...
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
-Liangent
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
On 08/03/12 03:09, Timothy Helck wrote:
Gentlemen,
Thanks for your previous suggestions.Unfortunately I've been busy with other things and I am just getting back to this.
I think I have found a reasonable strategy for searching images. I can use this query (siilar to what was suggested by Platonides): https://commons.wikimedia.org/w/api.php?action=query&list=search&srn...
Then I can parse the result set and create another query which gets me the urls: https://commons.wikimedia.org/w/api.php?action=query&titles=File:Chartre...
No need to perform two requests. The MediaWiki API generators can combine them for you: https://commons.wikimedia.org/w/api.php?action=query&generator=search&am...
However, I am still encountering a problem -- commons.wikimedia.org http://commons.wikimedia.org doesn't like requests that don't come from a browser. When I put these queries into php I get a 403 error. Is there a url where I can search wikimedia programatically?
regards,
Tim
You need to use an User-Agent which identifies your tool.
Platonides,
Thank you, that's really interesting.
Tim
On Thu, Mar 8, 2012 at 6:36 PM, Platonides platonides@gmail.com wrote:
On 08/03/12 03:09, Timothy Helck wrote:
Gentlemen,
Thanks for your previous suggestions.Unfortunately I've been busy with other things and I am just getting back to this.
I think I have found a reasonable strategy for searching images. I can use this query (siilar to what was suggested by Platonides):
https://commons.wikimedia.org/w/api.php?action=query&list=search&srn...
Then I can parse the result set and create another query which gets me the urls:
https://commons.wikimedia.org/w/api.php?action=query&titles=File:Chartre...https://commons.wikimedia.org/w/api.php?action=query&titles=File:Chartres%20cathedral%202881.jpg%7CFile:Chartres%20cathedral%202880.jpg%7CFile:Chartres%20cathedral%202879.jpg&prop=imageinfo&iiprop=url
No need to perform two requests. The MediaWiki API generators can combine them for you:
https://commons.wikimedia.org/w/api.php?action=query&generator=search&am...
However, I am still encountering a problem -- commons.wikimedia.org http://commons.wikimedia.org doesn't like requests that don't come from a browser. When I put these queries into php I get a 403 error. Is there a url where I can search wikimedia programatically?
regards,
Tim
You need to use an User-Agent which identifies your tool.
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
mediawiki-api@lists.wikimedia.org