• Feed

  • Sponsors

  • Clicky Ranking

    31905
    Ranking by getClicky.com

  • « Top10 list for 12.6-26.6 | Main | Gathering information from blogs »

    Clicky and Performancing widgets

    By maurizio | June 29, 2007

    If you are new here, you may want to subscribe to my RSS feed. Feel free to leave comments and questions too.Thanks for visiting!

    Two days ago Clicky published their own API together with a contest.
    The contest is simple: write something with their API (well, it’s a bit more complicated..).
    Performancing did the same thing..probably because they are using the very same code for stats. :-)
    Performancing has a contest too, but this time they give 100$ to the first 5 Widget/Plugins that uses their API!

    I decided to write a simple WordPress widget with their API. The first thing I saw was that they have an internal Ranking system, so I started with a widget that shows my ranking.

    I don’t know if you are really interested in how a Wordpress widget is made. The code it’s a bit difficult to read if you don’t know how Wordpress widgets works. Hopefully there is a simple widget to copy. If you go to the widgets site, they tell you to copy gsearch.php and start from there. That widget is very basic and it has a lot of comments.

    If you want to create your own plugin, just copy that plugin and then open it with your favorite editor ( I use notepad2, you can use notepad if you wish). The line you should take care of are:

    • The first 5 comments’ lines: Put your info there. It will be seen later on Wordpress’ widgets page
    • The lines starting with function. You should give them another name, according to what you are doing. If your widget show your name you can call them widget_name_init, widget_name and widget_name_control. Note that their name is repeated elsewere too. Maybe you can use “Find&Replace” to change them all
    • At the bottom of the code there are two register_xxx. Inside the array(), the first string is the name of the widget that you can see inside WordPress’ widgets page.Note that on the same line you have the name of 2 functions (see above point)
    • Near the end of the function widget_gserach (that you should have renamed) you see the core of the widget.This widget just shows a form for a google search.(echo is the command to print on the screen. Here you can change it with echo ‘Hi Maurizio!’; and it will print that.(Note that you can take the code I wrote here and use it there)

    Note that I haven’t written anything about widget_gsearch_control because you don’t have to change it for a simple task like this. That function is responsible for the setup page of the widget (the one you see when you click on it inside Wordpress’ widget page). You can safely delete everything inside it. Do not delete it completely or the code will not work because the end lines are still looking for it.

    If you feel confident you can go on and create a widget for Clicky or Performancing. Note that they are picky..it’s not enough to write a simple widget like mine to be accepted on the contest. At least that’s what they wrote me.
    Let’s see if they like my Top10 Widget I just finished to write.. I hope so, because I don’t know what else I could write, especially because I am using the free version of their stats and I will not be able to access all the stats. Even the Top10 widget will stop working when the beta period will end :(

    Download Clicky widgets here.
    Download Performancing widget here.

    Topics: Programming |

    Read other related posts:

  • Clicky API is out of beta
  • Clicky update
  • Clicky Widget List update
  • 5 Responses to “Clicky and Performancing widgets”

    1. Winston Ford Says: MyAvatars 0.2
      July 6th, 2007 at 4:21 am

      Hey, I read that blog on Performancing where you said you had just posted a widget. The guy who responded to you was just plain rude. period.

      He’s offering money to play with an api, and you put forth an effort and deliver a widget. The least he could say is, “Hey thanks man!”

      But don’t sweat it. Keep workin on your widget. Keep it simple. Widgets are simple by definition. Submit it on wordpress and where ever else, and let wp users be the judges.

    2. maurizio Says: MyAvatars 0.2
      July 6th, 2007 at 4:28 am

      Hey Winston, thanks for the comment!
      They don’t get that people doesn’t always want for free, because 100$ for a complicated widget is just like getting free stuff. I spent more than 100$/time to do the 3 widgets.

      I think that simple widgets are sometimes better than complicated widget.

      Ah..btw..you can’t do a lot of stuff with the free API.Even the Top10 you see here on the right, it will probably disappear as soon as they stop the beta testing, so why waste time if I’ll never buy a Paid subscription?

      Anyway I’ll probably post my widget on WP as you said.

    3. Clicky Widget Says: MyAvatars 0.2
      July 6th, 2007 at 9:36 am

      Maurizio,

      You posted on WP yet?!

      Here’s my Clicky widget for Netvibes

      You don’t need a Netvibes account to check it out

    4. Clicky Gadget Says: MyAvatars 0.2
      July 6th, 2007 at 9:39 am

      And here’s the Clicky Gadget for iGoogle homepage

      Likewise, you don’t need a Google account, just click n go

      -Winston

    5. maurizio Says: MyAvatars 0.2
      July 6th, 2007 at 10:12 am

      Yes I already posted them, but it takes some time to get approved.

    Comments

    Subscribe without commenting