问题
I am no expert, but I'm trying to write a universal script for searching on some website which is stored in a database, for example in the database is stored "ebay.com" and "amazon.com".
When I type in on my webpage into a text box any keyword (for example "iphone"), the stript will find:
On ebay:
http://www.ebay.com/sch/i.html?_trksid=p2050601.m570.l1313.TR9.TRC1.A0.Xiphone&_nkw=iphone&_sacat=0&_from=R40
On Amazon:
http://www.amazon.com/s/ref=nb_sb_noss_2/190-1864389-3911824?url=search-alias%3Daps&field-keywords=iphone
After getting this result I would like to store it in an array.
And i need that this script will work for every e-shops
回答1:
You can use Ebay and Amazon APIs. If you check the documentation you will see that some search functions are available there.
Ebay's finding tutorial with PHP and Javascript examples:
http://developer.ebay.com/Devzone/finding/HowTo/index.html
And Amazon's API reference
http://docs.aws.amazon.com/AWSECommerceService/latest/DG/CHAP_ApiReference.html
来源:https://stackoverflow.com/questions/19089932/search-script-which-find-web-page-in-website-stored-in-database