Pulling Amazon Rating Stars, Rating Count and Product reviews over the API
-
i there – good day – dear Paul, dear Developers and users,
first of all – i really like the Amazon Plugin. is is so great.
i want to have some extra featurs:
what i am after is the following: Pulling Amazon Rating Stars, Rating Count and Product reviews with Product Advertising API : What I am after is being able to pull just the stars, and the amount of reviews for a given product WITHOUT breaking the TOS of Amazon. I do not want to display all of the reviews
– but a part of them (i.e. the reviews) would be nice.,
and such that are inside of the iframe that they let you use. I am able to display the iframe, but I don’t need to display that much information. A Iframe is pretty awful. There much better solutions i guess.
So to be clear, I just want the Stars and the # of reviews (the average customer review, and # of reviews). i want to go the extra mile and tell me how, I’d really appreciate knowing how via PHP! If this is against the TOS, that’s all Id really need to know. If it is, I’d love it if someone could provide me a link to where it says that it IS against the TOS.
Thanks for any and all help! It’s always appreciated.to sume it up: don’t know about the TOS, but to do that in php, if there is no official api, we can use simple_html_dom: https://simplehtmldom.sourceforge.net/
<?php define('MAX_FILE_SIZE', 6000000); include './simple_html_dom.php'; //Your product amazon's url $url = 'https://www.amazon.com/SOL-REPUBLIC-1112-31-Headphones-1-Button/dp/B00COOVLMQ/ref=sr_1_1?s=fiona-hardware&ie=UTF8&qid=1470197678&sr=8-1&keywords=sol+republic'; $html = file_get_html($url); $review_section = $html->find('#averageCustomerReviews',0); $stars = $review_section->find('#reviewStarsLinkedCustomerReviews',0)->plaintext; preg_match('/\d+\.{0,1}\d*/',$stars,$match); echo "Stars: ".$match[0]; //Shoud be stars echo "<br />"; $reviews = $review_section->find('#acrCustomerReviewText',0)->plaintext; preg_match('/\d+/',$reviews,$match); echo "Reviews: ".$match[0] //Shoud be reviews number ?>
any ideas about more apropiate ways methods and options for doing that and achieving that
- The topic ‘Pulling Amazon Rating Stars, Rating Count and Product reviews over the API’ is closed to new replies.