hi,
I am trying to write a script which can do the following. I do not have any idea of how to write it ..but have the idea of how it should/will work.
I have a list of words in an mysql db(almost 1000 words). I need to take each word and then put in the search query of any search engine(for example ask.com) and store the result that appears under "related words"/"suggested words"/"narrow your search words" in a file.
Example:
If you search for the word "forum" in ask.com, we can see the url as
forum - Ask.com Web Search
and the search result page contains "Narrow Your Search"
Roman Forum
Free Forum
..
...
etc.
So I need to write a script that can take word by word from my mysql db and put it in the url (as below) and then store only the "result under "Narrow your search result" in a file.
Ask.com Search Engine - Better Web Searchnextword&search=search&qsrc=0&o=0&l=dir
Please let me know if its something possible and if I can have look at any examples..I would need to complete this as soon as possible.
I can explain it in a more better way if the above explanation is not clear.
Regards
feed search term into a url
Started by pragan, Jun 19 2008 01:23 PM
13 replies to this topic
#1
Posted 19 June 2008 - 01:23 PM
|
|
|
#2
Guest_Jordan_*
Posted 24 June 2008 - 04:04 AM
Guest_Jordan_*
This sounds possible. First "select" all of the words from your database and do a loop. I recommend using MySQLi if you have it installed. I wrote a blog on it here: PHP MySQL Improved
Next you'll use Curl to emulate a browser and connect to the search engine submitting the keyword you extracted from the database. From there you can retrieve the data and modify it how you like.
Next you'll use Curl to emulate a browser and connect to the search engine submitting the keyword you extracted from the database. From there you can retrieve the data and modify it how you like.
#4
Guest_Jordan_*
Posted 24 June 2008 - 08:48 AM
Guest_Jordan_*
Curl will return the contents of the website, he will just need to assign it to a string.
#6
Guest_Jordan_*
Posted 24 June 2008 - 11:04 AM
Guest_Jordan_*
lol. Also, there is no getch() function in PHP. There is ncurses_getch although it is experimental.
#8
Guest_Jordan_*
Posted 24 June 2008 - 11:16 AM
Guest_Jordan_*
Nope, unless it was custom made.
#10
Guest_Jordan_*
Posted 24 June 2008 - 11:20 AM
Guest_Jordan_*
You can use that with regular expressions to extract most of the HTML data you would need.
#12
Posted 24 June 2008 - 12:46 PM
Don't use me a scapegoat for your mistake. I cannot recall ever creating a custom PHP function with that name. However, getch() is a nonstandard C++ function to get a character from the keyboard. php


Sign In
Create Account

Back to top









