Archive for January, 2007

Google Pagerank Pepper for Mint: Prank

Tuesday, January 30th, 2007

For those that like to track Google Pageranking for their pages comes this new pepper. I had plenty of time to think on it today while waiting in court to have my speeding ticket resolved. Luckily I got the 4 point ticket reduced to 2 points with a doubled fine. Yay.

This pepper simply displays the Pagerank for each of the top popular pages. The number of pages displayed comes from the default pepper’s rows per pane setting. Knowing that Google gets cranky about constant requests for pageranks, I figured a little caching was in order. Since pagerank does not change so often, caching is set for 7 days. I don’t recommend changing this, but the setting is in the code and if there is enough demand I can add a pulldown to the preference pane.

This has been created for Mint 1 since I don’t have Mint 2 yet, but it doesn’t do anything exotic, so it should still work. Once I have the new Mint installed, I’ll take care of any errors that anyone finds.

You can pick up the new pepper at http://www.shokk.com/downloads/prank.zip

Nike+ iPod Update

Sunday, January 14th, 2007

Looks like a few things changed at the Nike site. My new script is updated to talk to their servers properly. The change is that Nike got rid of the external_profile_login request and now requires you to do a generate_pin request. Also be sure to create the cookie.txt file in the same directory that the niekplus.php script resides in. Nike moved to Akamai, but I’m still seeing instances where the servers do not respond, making the caching very necessary. Now, to do some running so that I can up that count. I’m REALLY behind on my new years resolution.

Get the new script here.

Nike+iPod API

Wednesday, January 10th, 2007

A few people have asked about how I pulled some of the URLs for communicating with the Nike servers. It all started with the Wordpress plugin which revealed the first pair of URLs we needed and how to utilize them.

https://www.nike.com/nikeplus/v1/services/app/external\_profile\_login.jhtml?
    login=$username&password=$password&locale=en_us


and

http://www.nike.com/nikeplus/v1/services/app/getuserdata.jhtml



The first URL is called and returns this XML structure and a cookie needed to call the second URL.

<plusService>
<status>success</status>
</plusService>


The second URL returns an XML structure that contains all the basic run data:

<?xml version="1.0" encoding="UTF-8"?>
<plusService>
    <status>success</status>
    <user>
        <gender>male</gender>
        <email>ernieoporto@yahoo.com</email>
        <postalCode>08844</postalCode>
        <state>NJ</state>
        <city>Hillsborough</city>
        <country>US</country>
    </user>
    <userTotals>
        <totalDistance>54.8335</totalDistance>
        <totalDuration>26698062</totalDuration>
        <totalRuns>14</totalRuns>
        <totalCalories>4476</totalCalories>
    </userTotals>
    <userOptions>
        <screenName><![CDATA[shokk]]></screenName>
        <distanceUnit>mi</distanceUnit>
        <dateFormat>MM/DD/YY</dateFormat>
        <startWeek>Su</startWeek>
        <avatar>2</avatar>
        <powerSong>
            <artist><![CDATA[Korn]]></artist>
            <album><![CDATA[Untouchables]]></album>
            <title><![CDATA[Wake Up Hate]]></title>
        </powerSong>
    </userOptions>
</plusService>


As you can see, it has all my basic info, even as to which avatar I picked for my account. It is this data we use to make the info you see in the current sidebar. Next, knowing that the Nike+ iPod widgets published for use with Yahoo Widgets could get challenges and goal data, I downloaded them, grepped the files for “http” and got a bunch of results which yielded these URLs:

https://www.nike.com/nikeplus/v1/services/widget/generate_pin.jhtml
https://www.nike.com/nikeplus/v1/services/widget/generate_token.jhtml
http://www.nike.com/nikeplus/v1/services/widget/check_version.jhtml
http://www.nike.com/nikeplus/v1/services/widget/getchallengedetail.jhtml
http://www.nike.com/nikeplus/v1/services/widget/getchallengesfor_user.jhtml
http://www.nike.com/nikeplus/v1/services/widget/goal_list.jhtml
http://www.nike.com/nikeplus/v1/services/widget/token_login.jhtml
http://www.nike.com/nikeplus/?token=”+token
http://www.nike.com/nikeplus/?l=goals,”+challengeID+”&token=”+token
http://www.nike.com/nikeplus/?l=challenges,”+challengeID+”&token=”+token


and knowing that the https URLs were authenticated with login=USERNAME&password=PASSWORD&locale=en_us
(be sure to replace my en_us locale with your own locale), then I could make use of the above to grab data. Except if you look a the first two URLs we made use of, “app” is in place of “widget”. So with a little substition, we get an XML response that we can parse to get runIDs, challengeIDs, and goalIDs.

The next mystery is how to get and make use of the TOKEN. After much fooling around with the above URLs, I realized that the generate_token and generate_pin were really doing the same thing. So that this call

https://www.nike.com/nikeplus/v1/services/app/generate\_pin.jhtml?login=USERNAME&
    password=PASSWORD+generate\_pin.jhtml&hl=en&gl=us&ct=clnk&cd=2

generated something like this structure:

<plusService>
<status>success</status>
<pin>02A3E14F-09E7-7230-3C43-4BAF31FC5A33</pin>
</plusService>

and 02A3E14F-09E7-7230-3C43-4BAF31FC5A33 turns out to be the token/pin that can be used in the bottom three URLs to take you to the Flash pages showing the challenge, goal, and run data. This is the equivalent of the username and password pair for getting you onto the nikeplus.com site. And no, that is not my real real PIN. =) This seems to really only be useful for the runner, and not very interesting for anyone the runner is sharing with.

The rest of the work is parsing and processing the various results of the authenticated URLs. Note that the nikeplus.com site has been undergoing some serious growing pains after the 2006 holiday season and has been a bit flaky. For this reason, the caching ability of the nikeplus script is very important. And even now they have chosen to update their widgets and the authentication URL is returning “login from locale not allowed” while the widgets themselves say “We’re actively restoring the nikeplus Yahoo Widgets. Your patience is trophy-worthy. Check back soon! Upgrade”. Their community boards are full of complaints about this, but hopefully they will get past this problem.

On their site they have a new Resolutions Flash widget for web sites that makes use of the same ID info for challenges and goals. As you can see, I’m very much behind on my goal.

In my next installment, we’ll go over what the data for run, goal, and challenges XML looks like.

MonkeyChow update

Tuesday, January 2nd, 2007

Well, I’m back to updating MonkeyChow over the Christmas break. I recently saw how FeedOnFeeds just released some new code for the pre-0.6 version. I have to say that I like what has been done. However, I think that it’s still missing a number of things and its not very pretty. Likewise, there are things that I’m not happy with in Google Reader that have prevented me from going over to that platform. I’m used to the things that I have added to MonkeyChow, so I am in the process of seeing how some of that stuff will port over.

First, because of all the changes taking place, I need to make it easier to do upgrades. The installer is going to be changed so that it will in effect do a sanity check on the database so that each time there is an update the database state will be examined and changed to add any necessary columns. This will make the whole system more user friendly, where in the past I’ve asked people to do the changes manually. Some of this code was donated by Andrew Arensburger back in May, but I never did anything with it.

Logins and prefs. The logins get rid of the need to play with .htaccess, which is another manual step we want to get rid of. I have logins working, but I need to port in some of the code for preferences. I’m thinking of turning keyboard shortcuts on permanently since a number of people have asked for them. Somewhere in the prefs will be a choice of whether the frames or panel view is kicked off at login.

Now that we have identities through these logins, I also want to create some sort of community experience with MonkeyChow, so I’m looking to see if I can do something with a bulletin board like Vanilla. Likewise, a plugin for Vanilla that shows what lists you are subscribed to would be neat. The existing privacy features of MonkeyChow will still be respected in all this, of course.

The MonkeyChow UI needs to get prettier. I’ve been doing some work with this, but I know it’s not what everyone else wants. I want to extend the prefs so that I can stick all the current CSS into a themes folder and let people create and pick other themes. I don’t know how crazy we want to get with themes, but let’s see where this goes.

Plugins. I like the idea of this. I’d like to move a lot of things like the social bookmark buttons into a plugin(s) so that people can choose whether or not to get rid of that. Things like reminders and article filters will fit nicely here. But again there is room for some other social aspects like being able to see each others accounts and things like IM login status and Last.FM lists, to name a few examples. I really like how Vanilla BB does this.

Translations. If you’ve talked to me about providing a translation, please get that to me when you can. I still want to get MonkeyChow translated into a couple more languages as a requirement before we go to 1.0 (way down the road). This would give it much greater visibility.

Bugs. MonkeyChow has them. One annoying one I really want to quash is that it picks up old articles after they have been deleted from the database. Some feeds are keeping articles for many many months, and when MonkeyChow deletes the article after 60 days the article can come back in. In some cases this can be fixed by setting a date field according to what dc:date says for that article in the feed, but there are also some feeds that are not setting a date for their articles and that is a big pain to get around. If you know of any others that are keeping you from making MonkeyChow your full-time reader, please don’t hesitate to open an account on the support forums and voice your concern.

Does anyone want to see blog reading stats, like the new stuff in Google Reader?