Is it possible to fetch videos and images of a particular website and put it into post? i mean i am thinking of writing a function, where i will just write the website name, and then with the help of website url, all or latest images and videos are posted to my post. Is this possible?
2 Answers
The problem with this is that each sites content is formated differently. If there was only one site you were wanting to pull from you maybe able to use curl() and then sort though the content.
A better idea may be to grab content from the sites RSS feed and sort though and grab what you need.
You could probably write a quick plugin that would either grab the feedurl of the site and display images or you enter the feed url and it displays content.
This is also just a friendly reminder about copyright and being mindful of the content you're pulling ;)
-
but rss feeds does'nt pulls images and videos? am i rite? i have heard some where Jan 9, 2011 at 9:11
-
It depends but most feeds should have images and videos. At very least they should have links the the content.– Brooke.Jan 9, 2011 at 9:17
-
1
-
ok guys i need ideas and suggestions over here, if i ll write a function where instead taking images and videos from particular site, is it possible i take it from google? for example in google images if i type "Apple" then i get images of apple, but in such a way, that this apple wont be typed in google but into my dashboard, and it will go to google and display it on my blog is this possible? Jan 9, 2011 at 15:09
-
You will have to "scrape" google images (google 'scrape google image php'), using the
get_search_query()
to set the variable to search for in your search.php file. Just be aware that scraping content is often frowned on, look out for googleWrath. Jan 9, 2011 at 16:10
ntechi,
To answer your question in the comment above ("is it possible i take it from google? for example in google images if i type "Apple" then i get images of apple, but in such a way, that this apple wont be typed in google but into my dashboard, and it will go to google and display it on my blog is this possible?")
The answer is more than likely "no". This wouldn't be from a technical aspect but a legal one. You can't be aware of all the laws regarding copyright with the websites you are grabbing the images from (depends on what rights they provide, where they are located in the world, where the server is located, etc.).
Also, if you hotlink you may get a default "don't hotlink" image (which defeats the purpose) and if you do copy the image over, you could be violating even more laws.
Sorry I don't have a better response.
Cheers
Noel