1

I have to develop a web app that shows certain places on a map, and those places can be found on another websites map already... is it possible that, from my app, I call that other website search form and gather the results?

diminuta
  • 1,545
  • 8
  • 32
  • 55

3 Answers3

5

I would recommend to use a standard API for that:

  1. YQL:

    The Yahoo! Query Language is an expressive SQL-like language that lets you query, filter, and join data across Web services.

  2. Bing API: typical usage.

  3. How can you search Google Programmatically Java API

Community
  • 1
  • 1
0x90
  • 39,472
  • 36
  • 165
  • 245
3

Its possible... but legality is another question.

If search engine on "another" web page using GET, then its simplier (of course, with POST can it be done too). Just create URL, load its content within your app and then write parser for resulting HTML. There is big probability, that results will be formated in stable way (table, divitis), so its easier. Just write simple regex for result HTML (or other type) and get results from that.

Problem with this "brute force" data mining from search result is, that if they change their page, your app "goes to hell". In my application, I solve that using extarnal config file including URL where you change only search query and external regexp.

Example:

URL: http://www.example.com/search.php?query=[SEARCHED_DATA]

Text [SEARCHED_DATA] is within app replaced with whateever you are searching.

If page is changed, you can easily commint app update without need of rebuilding it.

Some pages offering search APIs, which are better way. But from your question, I assume, that this it not the case.

Martin Perry
  • 9,232
  • 8
  • 46
  • 114
3

Your best bet is to try to integrate with web sites which offer up some sort of API access to their data. Trying to scrape HTML from a 3rd party site is asking for trouble.

Mahesh Guruswamy
  • 769
  • 5
  • 15