Hello everyone

i am new here and i searched in the website but could not get the answer so them to my wey problem
i am making a college project where i have to make a list of items from different website and bring them to my website

eg:-
just like a shopping list
but i want some product from gooogle shoping
and some from ebay

so i want to make a web site where i can gather these items into a list
i want to fetch photo and title of the product from that site with the help of the url
please some body help me and can provide a solution

Recommended Answers

All 8 Replies

Might be a lot easier if you download the photos and grab the text manually.

Member Avatar for diafol

No. This is a php help forum. Post your code, then you get help when you're stuck. How many other forums have you opened an account with to get some poor sap to do your research/work for you? Come back when you have shown the fruits of your labour.

i am really sorry to hurt the feelings of this forums but just wanted to know how to start as i am really not into php but as it is my college project so was just getting an idea

thank you

Member Avatar for diafol

No hurt feelings. Look, you've posted to a 'php help-with-your-code forum'. If you don't need help with your code, that's OK, but at least have a list of things you've tried and think may be worth investigating but haven't got the background knowledge to implement. Free lunches aren't on the menu. Good luck though. Come back later after you've done some research.

If this is a college project, you'll probably need to show your research efforts anyway.

I'll give you my 2c though. You want to display data/images from other sites on your site. Do you have permission? Are the images copyrighted? Is the data (text) taken directly? Do you have permission? In fact, do you even need permission?

The answer to this may direct your project. If the project is a local affair and not going to be available to the masses, this may be OK if your assessors are judging you on your ability to code / present /organize. I would be surprised however if they didn't consider copyright / intellectual rights when assessing your work.

The technique you need to research is called web scraping, as already mentioned it is regarded as somewhat unethical. If you search Google for "PHP Web scraping Tutorials" you will come up with a lot which will give you a good start.
You may also wish to search relevant donor sites for API's the provide content to your application, for example Flickr photo site has an excellent API that allows you to retrieve public access images with a given tag. Google shopping also has an API.
Good luck.

It's ok as long as you have permission. I have actually built several like this. At work we have url wrappers turned off but generally it is turned on though. If url wrappers are turned on then you can just do a file_get_contents on the url save that to a file and rename the file to the name of the image. If you know or would like to get into bash a little, wget is even easier. If neither one of those are an option then you will probably need to do some research in the cURL department.

Thank you guys
many thanks to ardav . I considered the permissions and all the stuff this is just a college project and i dont need any permission as i will be taking from some dummy site but while showing it they might use it directly taking from the net so was little bit concenred and yes thank you all for the help got lot of info on php scraping t

once again thanking you

Ok, I have done this before.
You will need a php class that:
has a list of websites to search,
will search particular pages for the given keywords
will "click" the link to the returned content.
will search the returned page for the image in question based on approximate size/surrounding tags to determine correct content.
will process file to check has no internal bugs(like xss)
will download content to your server
will terminate search and return file retrieved with input to handler script

You will then need a script that executes the class with supplied keywords.

You will also need a cron job using *nix to fire off this script so as to not overload your server/automate the process.

I hope this helps! Let me know if you need assistance understanding this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.