Tagged: google RSS Toggle Comment Threads | Keyboard Shortcuts

  • Ankit 4:11 pm on May 4, 2012 Permalink | Log in to leave a Comment
    Tags: , google, , ,   

    My amazing wordpress widget with google search shopping API 

    Hello guys,
    This time I got my hands wet with Google shopping Search API. ;)

    I read about this api yesterday and thought that I should try to implement this API functionality in my wordpress widget.

    The Search API for Shopping is intended for developers who want to programmatically query data that has been uploaded to Google via the Google Merchant Center.

    The Search API for Shopping targets the following use cases:

    1) Developers can build applications that query product offers across merchants.
    2) Merchants can use the API to query their own data by becoming a Commerce Search user.
    3) Publishers in the Google Affiliate Network can use the API to access product offers from their advertisers of choice.

    In fact this API is too much extensive to it’s scope and can be very useful to the sites which are mainly intended towards the product search for consumers, also it can be very useful to more revenue generation because with the help of this API you can programatically display any offers and products from a perticular publisher.

    All the above mentioned stuff was intro (or you can also call it a speech if you wish so.. ;) ) about the Search API for shopping.

    now it’s time to get practical:->
    You can copy and paste the following code to create custom widget implementing google shopping api.

    /******************** Code Starts Here *************************************/
    function widget($args, $instance){
    extract($args, EXTR_SKIP);

    echo $before_widget;
    $title = empty($instance['title']) ? ‘ ‘ : apply_filters(‘widget_title’, $instance['title']);
    $api_key = $instance['api_key'];
    $search_q = $instance['search_q'];
    $by_brand = $instance['by_brand'];
    $results_to_show = $instance['results_to_show'];

    if(empty($results_to_show)){
    $results_to_show = 6; /* Default results to show is 6 */
    }

    $get_search_q = explode(‘ ‘, $search_q);

    if(count($get_search_q)>1){
    $more_term = 1;
    }
    //$product_url = ‘https://www.googleapis.com/shopping/search/v1/public/products?key=’.trim($api_key).’&country=US&q=netbook’;

    $product_url = ‘https://www.googleapis.com/shopping/search/v1/public/products?key=’;
    if($api_key && $search_q){
    $product_url .= trim($api_key).’&country=US&q=’;

    if(isset($more_term)){

    for($p=0;$p1){
    $more_brands = 1;
    }
    }

    /* If brands are present and more than one */
    if(isset($more_brands)){

    for($p=0;$pitems as $key=>$val){
    array_push($img_arr,$val->product->images[0]);
    array_push($title_arr,$val->product->title);
    array_push($inventory_arr,$val->product->inventories[0]);
    }
    //print_r($img_arr[0]->link);
    //exit;
    if (!empty($title))
    echo $before_title . $title . $after_title;

    if(count($title_arr)){
    if(count($title_arr)>$results_to_show){
    $result_to_display = $results_to_show;
    }else
    $result_to_display = count($title_arr);
    ?>

    <?php for($i=0; $i

    <img alt="img-” title=”" src=”link; ?>”/>

    <?php }
    }
    echo $after_widget;
    }

    }

    function rtp_child_register_widgets() {
    register_widget( 'google_shop_widget' );
    }
    add_action( 'widgets_init', 'rtp_child_register_widgets', 11 );

    /******************** Code Ends Here *************************************/

    you can make your widget as much extensible as you wish it to be.

    Currently it will ask you title for widget, what products (one or more) to search, which brands to search (optional) and number of results to display on widget.

    there is one more option for API key it's because u hav to register urself for using google API's for getting access to API through API key.

    You can also watch out my working example at http://ankit.rtcamp.info

    Hope this will be helpful to you all any point of time.
    ( Do not forget to vote if you like it :) )
    Thanks :)

    VN:F [1.9.17_1161]
    Rating: +1 (from 1 vote)
     
  • Rahul Bansal 7:11 am on May 3, 2012 Permalink | Log in to leave a Comment
    Tags: google, google chrome, google fonts, preview   

    Google Font Previewer for Chrome 

    Must use Google Chrome Add-on for Developers/Designers.

    https://chrome.google.com/webstore/detail/engndlnldodigdjamndkplafgmkkencc

    VN:F [1.9.17_1161]
    Rating: 0 (from 0 votes)
     
  • Radhe 11:16 am on January 5, 2011 Permalink | Log in to leave a Comment
    Tags: docs, google, Spreadsheet   

    adding date row or column wise inside Google Spreadsheet

    http://www.google.com/support/forum/p/Google+Docs/thread?tid=58ac11df570b9332&hl=en

    VN:F [1.9.17_1161]
    Rating: 0 (from 0 votes)
     
  • Radhe 5:40 am on December 23, 2010 Permalink | Log in to leave a Comment
    Tags: chat, config, google, pidgin   

    Configure Pidgin to connect to Google Talk for Google Apps

    http://www.google.com/support/a/bin/answer.py?hl=en&answer=49147

    VN:F [1.9.17_1161]
    Rating: 0 (from 0 votes)
     
  • Prasad 3:02 pm on October 29, 2010 Permalink | Log in to leave a Comment
    Tags: google, Google Analytics   

    Google Analytics Helpful links. 

    Here are the helpful links to implement the Google Analytics for event tracking.

    VN:F [1.9.17_1161]
    Rating: +2 (from 2 votes)
     
  • Santosh 11:20 am on July 17, 2010 Permalink | Log in to leave a Comment
    Tags: google   

    recursion on google search 

    search for “recursion” on google and observe you see something different. . .

    VN:F [1.9.17_1161]
    Rating: 0 (from 0 votes)
     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel