Archive for Cuvedev

Facebook Like-button on Netlog

// mei 3rd, 2010 // No Comments » // Cuvedev, Development, Facebook, Greasemonkey, Netlog, script, Userscript

I just finished another userscript/greasemonkey script for Netlog.
Since Facebook made their ‘like’ button public, I thought it would be a nice idea, to share your favorite photos, links, videos and blogs from Netlog, on facebook.
This might direct more visitors to Netlog, and some may even be convinced to register.

Download below. Watch out, it’s still in beta.
One known bug is that the script doesn’t really work together with the ajax photo browsing.

Note, make sure your Netlog profile and the item you’re liking is accessible when not logged-in (otherwise Facebook can’t handle it)

Screenshots:








Tested on Firefox 3.6.3 and Chrome 5.0.375.28 dev
Note: Firefox users need the Greasemonkey plugin!

Enjoy!

Download:
netlog_like.user.js (0.4, beta)

UPDATE:
Newer version available

Thx to Jochen Delabie and Oemebamo for the remarks

Gowalla API Class (php)

// april 14th, 2010 // 18 Comments » // api, Cuvedev, Development, gowalla, php

I just quickly made a class for accessing the Gowalla API because I needed it myself. I looked for an existing class on the internet but could only find some crappy stuff on Google Code.
So I decided to make one myself.

The use of the class is fairly simple. Include the class file (don’t forget to add you API-key), make an instance and do your calls.
The class internally uses CURL to do the requests to the server and returns the data as an associative array.
I tried to document the methods enough so it’s easy to use them.

Example:

<!--?php
include('./class.gowalla.php');
$gowalla = new GowallaAPI();
$events	 = $gowalla--->getSpotEvents(846403);
foreach ($events['activity'] as $event)
{ // do stuff }
?&gt;

Feel free to download and comment.

Boxee python dev

// april 10th, 2010 // 3 Comments » // Boxee, Cuvedev, Python

Boxee may be “the best way to enjoy entertainment from the Internet and computer on your TV” (according tor their website), the developers documentation isn’t all that great. Not everything is well-documented and the (python) API doesn’t always do what’s expected, which makes developing own plugins not that easy.
It isn’t also always possible to find the right solution with Google. Maybe because not all that much people are developing plugins for Boxee (or the don’t care to share) or because Google doesn’t index it well.

So I decided to share the things I found. Let’s hope google indexes them well and I’m able to help some fellow developers.

Textbox + SetLabel:
If you have a textbox, it is not possible to change the label via python in an easy way.

mc.GetActiveWindow().GetLabel([id]).SetLabel('text')

and

mc.GetActiveWindow().GetControl([id]).SetLabel('text')

don’t work on a Textbox, and

GetTextbox([id])

doesn’t exist.
Setting the label can be done this way:

xbmc.executebuiltin('Control.SetLabel([id],[text])')

and you’ll have to replace every comma (,) with $COMMA

Onload-tag with a dialog
I’ve experienced some troubles with the onload-tag in windows with type=”dialog”. If you have a normal window, and load a dialog-window in a onclick method with this code, the onload of the dialog won’t work until you close the dialog:

 
<![CDATA[ mc.ActivateWindow(14001) ]]>

The way to solve this is to dump the python code to load the dialog and just do this:

	ActivateWindow(14001)

Python import gives errors:

It took me a while to figure out, but this error:

18:54:51 T:2963869696 M:410439680  NOTICE: --&gt;Python Interpreter Initialized&lt;--
18:54:51 T:2963869696 M:410439680  NOTICE: Traceback (most recent call last):
18:54:51 T:2963869696 M:410439680  NOTICE:   File "", line 2, in ?
18:54:51 T:2963869696 M:410439680  NOTICE: ImportError
18:54:51 T:2963869696 M:410439680  NOTICE: :
18:54:51 T:2963869696 M:410439680  NOTICE: No module named xxxxxxx
18:54:51 T:2963869696 M:410439680   ERROR: Scriptresult: Error

Was caused by a bad window-id. Boxee window-id’s should be between 14000 and 14099

Close a window with type=”dialog”:
If you have opened a window with type=”dialog”, it isn’t possible to close the window with this code:

CloseWindow(14001)

Instead you have to do this:

Dialog.Close(14001)

You can also add the “force” option (True/False), adding this option will skip all animations.

Boxee StuBru Plugin

// april 5th, 2010 // No Comments » // Cuvedev, script

So … I finally finished my first Boxee plugin. Funny tough, it’s non of my previously planned plugins.
Today I got the inspiration to make ¬†a small but handy plugin. Studio Brussel was airing “De zwaarste lijst”, a list of hard rock and metal music tonight, and I thought it would nice to listen to it with Boxee because it uses my Logitech Z-5500. ‘Nuff said right?

So here it is. It’s extremely basic, but it does what it was supposed to do, play stubru music.
Download and enjoy!

Download my stubru boxee plugin

Tested on Boxee Beta for OSX and Ubuntu.

Netlog static header

// maart 18th, 2010 // 3 Comments » // Cuvedev, Netlog, script

Since the Netlog chatbar disappeared from the bottom of the screen, there’s no easy way to quickly navigate to another page or add content or whatever when you’re not at the top of the page.
If only the current header would be static …

With this userscript it is:
Click to install: netlog_topbar_1.1.user.js (latest version)
Click to install: netlog_topbar.user.js (older version)

UPDATE:
Newer version available

Tested in Firefox 3.6 and Chromium 5.0

Update:
A new version is out (v1.1).

Changes:
- In this version the new tabs in People and Logs are visible.
- There’s a Netlog version check. The header isn’t static in v4, only in v5.
- This version also works better with MagicDebug