Link to home
Create AccountLog in
Avatar of phpintheusa
phpintheusaFlag for United States of America

asked on

scraping dailymotion.com with php?

How can I scrape dailymotion.com for cetain tv shows and return the title and video file's link so I can display the title and video on my page?
Avatar of b0lsc0tt
b0lsc0tt
Flag of United States of America image

phpintheusa,

For PHP look at using cUrl (http://www.php.net/curl).  It is used to read the content of a page (even one not on your server).  The results can be placed in a string variable that you could then parse to get the info you want.

Look at the HTML to see what options you have for parsing the content to get just the info you want.  In some cases this will need to use script and regular expressions (e.g. preg_match).  If the html is well formatted and you want an option that may be easier you could look at some PHP XML/HTML parser.  Let me know if you need a recommendation.  In the past I have usually done it manually with expressions but I have seen one that you might be interested in.

Let me know if you have any questions or need more information.  If you need expert help then you will have to start working on this on your own and ask specific questions.  This is a big project to do for free in a single question. :)

b0lsc0tt
ASKER CERTIFIED SOLUTION
Avatar of b0lsc0tt
b0lsc0tt
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of phpintheusa

ASKER

Thank you, good direction pointing. It is just for my own personal use, just experimenting, constantly trying to learn more.
Your welcome!  Enjoy.  It can be real fun to learn those things.  It will give you wide variety of things to try and use in PHP.  I'm glad I could help.

Thanks for the grade, the points and the fun question.  If you have more questions related to this and want to attract my attention to them then feel free to post the URL of the new question in a comment here.

bol