PDA

View Full Version : niche site example using the Prosperent API



Prosperent Alex
01-03-2012, 02:28 AM
This is a simple example of how you can create a niche site using the Prosperent API technology. To accomplish this, we can use the brand filter ('filterBrand') and pass an array of values from which we want to search.

example site: http://www.gamegrabbr.com


$brandArray = array('Sega Genesis','Super Nintendo','Wii');

$api = new Prosperent_Api(array(
'api_key' => <your_api_key>,
'query' => 'something cool',
'enableFacets' => true,
'filterBrand' => $brandArray
));

So now if a visitor queries "panties", no results will be returned (unless sega starts selling them for some reason).

Now if you're still wanting to let your users to be able to filter the results themselves, we could do this instead of the above. (this is what gamegrabbr.com is using).



// if a brand parameter is set then we will filter by that given value (what the user
// is wanting to filter by). if its not set then we filter by the array.
$brands = $params['brand'] ? $params['brand'] : $brandArray;

and our filter would become: 'filterBrand' => $brands

So there you go, maybe this will spark some ideas:)

deafbiz
01-05-2012, 11:23 AM
I did a search for a popular game and there was no result, probably because it's all images and no text. Is it up to me to decide if I wanted text for each product?

prosperent brian
01-05-2012, 11:24 AM
You can display whatever you want from the api.

Prosperent Alex
01-05-2012, 12:28 PM
Exactly what Brian said, all of the product data is still returned as normal, however I'm only displaying the image and the merchant name.

just do:


$api->fetch();
$allData = $api->getAllData();

echo '<pre>' . print_r($allData, true) . '</pre>';

And you'll see it's all there. I would just guess that whatever game you searched for isn't available.

Hope that helps.

deafbiz
01-05-2012, 02:01 PM
I was searching for the best seller game. How can it NOT be there? ;-)

prosperent brian
01-05-2012, 02:03 PM
What is it lol?

prosperent brian
01-05-2012, 02:08 PM
If you mean COD Black Ops (top selling game of 2011), it comes up fine on the site. http://www.gamegrabbr.com/search?query=Call+of+Duty+Black+Ops+xbox&search=Search

or

http://www.gamegrabbr.com/search?query=Call+of+Duty+Black+Ops&search=Search

and it's listed on the home page as well.

Prosperent Alex
01-05-2012, 02:10 PM
What game was it? If it was Assassins Creed then yea there was a problem with an unescaped quote, but should be fixed now.

deafbiz
01-05-2012, 03:36 PM
Try Just Dance. FYI, Just Dance 3 is excellent for Wii and seems everyone I know has it.

Update: After posting this, I went back to the website and Just Dance is there. Strange that it wasn't there earlier today.

Prosperent Alex
01-05-2012, 04:12 PM
:)