How do I get the results of search engine query from c2 app

Get help using Construct 2

Post » Mon Apr 06, 2015 10:21 am

I've been reading about the AJAX object in Construct2. Is it possible to send out an AJAX request to a search engine website (Google, for example) then be able to retrieve and display the search results in the construct 2 app? How do I work with AJAX.Lastdata to do this if it is possible?
B
5
Posts: 5
Reputation: 235

Post » Mon Apr 06, 2015 4:56 pm

Anyone? :D
B
5
Posts: 5
Reputation: 235

Post » Mon Apr 06, 2015 7:17 pm

its possible but it will probably be more work than its worth.. You can send an AJAX request to your PHP server and then call a PHP function to read a webpage to string

$content = readfile("https://google.com/")

with google you can pass it search parameters in the URI string Example.

$content = readfile("https://www.google.com/#q=scirra")

From there you can parse the html code received and do what ever you want with it but you're in effect attempting to create a webcrawler and parsing HTML is a daunting task. I wish you luck in your journey. :)
B
20
S
7
G
1
Posts: 221
Reputation: 2,077

Post » Wed Apr 08, 2015 7:15 pm

Appreciate the response troublesum. Although im still a bit lost. :))
B
5
Posts: 5
Reputation: 235


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], Soulmachine and 12 guests