Jump to content

Recommended Posts

I need to make a script that searches specific sites for a person name ex "Tom Hanks" and gets how many articles or discussions there are on those sites in a time frame.

 

Results: Searched for "Tom Hanks", there were approximately 1200 articles or discussions created between Feb 2/Feb9, 2009. in the following sites (Site 1) (Site 2).

 

 

I would really appreciate heads up on this. Would it be also possible to use google to search specific sites for specific words during a given time frame. Maybe a syntax.

 

This will be a challenge for me

 

 

Link to comment
https://forums.phpfreaks.com/topic/143364-need-help-for-an-algorithm/
Share on other sites

So search 'www.imdb.com' for 'tom hanks' in the last Year you could do this:

http://www.google.co.uk/search?as_epq=tom+hanks&ft=i&as_sitesearch=www.imdb.com&as_qdr=y

 

 

to search for a date range, Well Google offers some options regarding the date when a page was updated, but they are pretty fuzzy: you can restrict the results to pages updated in the past 3, 6, or 12 months.

 

There's also a daterange operator, with the syntax daterange:startdate-enddate. Unfortunately, the dates must be entered as Julian dates (the Julian date is calculated as the number of days since January 1, 4713 BC).

 

Hope that helps

maybe something like this

 

function SearchMovieDb($keyword) {
$keyword = str_replace(" ","+",$keyword);
$content[0] = "http://www.imdb.com/find?s=all&q=$keyword";
$content[1] = "http://www.fandango.com/GlobalSearch.aspx?wssac=131&tab=Movies+People&q=$keyword&wssaffid=11828_MoviesDotCom&repos=People";
$imdb = file_get_contents($content[0]);
$movies = file_get_contents($content[1]);
}

 

i might have missunderstood your question completely tho... :P

Thanks avon for the feedback...I rather make thing simple.

 

Finally I have decided that I will choose google as they do the best in indexing.

 

I have made a search query as follows

 

 
allintext:  "Jan,28 2009" | "28 Jan 2009" | 28 Jan 2009" |"1/28/2009" | "1/28/09" | "1/28/2009" | "1.28.2009" | "2.2.2009" "Tom Hanks" site:imdb.com 

 

this query pretty much gets the result for tom hanks in imdb for that specific date...The query is not perfect and can be narrowed.

 

I need to make a script or some sort that sums the total number of links that Google finds for the above query and store in a database. I would appreciate some feedback.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.