Page 1 of 1

#8 Buddy-List

Posted: Fri Mar 08, 2013 8:17 am
by CodenStuff
Welcome to challenge #8

Buddy-List

Today's challenge is going to be the first of a multi part challenge involving the use of the Codenstuff API.

The challenge for today is to create something that lets a user login/connect to the API and display their friends list. The API outputs information in both Json and XML format so it can be used with all types of languages and this challenge is not restricted to any single platform so you are free to choose how you want to make this challenge, a desktop app or web application/widget.

For details on how to use the API please see this section: viewforum.php?f=226
...and specifically this topic gives details on how to get information: viewtopic.php?f=226&t=10259

You can see your unique API key (which you will need to connect to the API) in the top-right corner of that forum section as shown here:

Image

For those of you who are new to Json/XML to give you an idea of what the data looks like this is what my friend list looks like in Json format:
Code: Select all
[{"id":"871","name":"comathi","avatar":".\/download\/file.php?avatar=871_1323826793.png"},{"id":"1965","name":"Filip","avatar":"https:\/\/dl.dropbox.com\/u\/40082347\/e.png"},{"id":"56","name":"hungryhounduk","avatar":".\/download\/file.php?avatar=56_1303713835.gif"},{"id":"616","name":"Scottie1972","avatar":".\/download\/file.php?avatar=616_1355449724.jpg"}]
This is what it looks like in XML format:
Code: Select all
<cnstweets>
<id>871</id>
<name>comathi</name>
<avatar>./download/file.php?avatar=871_1323826793.png</avatar>
<id>1965</id>
<name>Filip</name>
<avatar>https://dl.dropbox.com/u/40082347/e.png</avatar>
<id>56</id>
<name>hungryhounduk</name>
<avatar>./download/file.php?avatar=56_1303713835.gif</avatar>
<id>616</id>
<name>Scottie1972</name>
<avatar>./download/file.php?avatar=616_1355449724.jpg</avatar>
</cnstweets>
The topic I mentioned above contains a VB.Net example of how to use the API in Json format so you can use that as a starting point if you wish. The example uses the dummy API so you will need to change that to use the Live API and add some type of login form then get the friends list and display it in some form.

This is how you would get a users friends list from the API url:
api/LiveAPIJsonXML.php?mode=Mates&usern ... =ABCD12345
To get it in XML:
api/LiveAPIJsonXML.php?mode=Mates&usern ... output=xml
To create a login you would use the "SelfProfile" option of the API as this outputs your account information, if you call this and get a fail message then login is incorrect but if you receive json or xml data then login is successful and you can also use the returned data to get the users color, email, post count etc.

For login:
api/LiveAPIJsonXML.php?mode=SelfProfile ... ABCD123456
You need to have friends on your list otherwise you wont get any data. If you don't have any members added as friends on your account yet then visit their profile page and click "add friend".

Requirements for this challenge:
You can use any programming language and platform to create this.
A usable entry must be submitted. If its a desktop app please upload the file, if a web app please provide link to use it.
User must be able to login and display a list of their friends.
The friends list must not simply be displayed in raw json or xml format. You have to extract the information from the data and display it in some form. A list of usernames or avatars are acceptable.


Post the entry when finished and please keep the files as you will need them for the next part of this challenge later this month.

Good luck cooll;

Re: #8 Buddy-List

Posted: Fri Mar 08, 2013 1:33 pm
by comathi
Nothing major:
Image
Image


This file is hosted off-site.

Re: #8 Buddy-List

Posted: Sat Mar 09, 2013 8:15 am
by Skillful
My entry just in the nick of time :)
MMDC 8 - Buddy List.zip

Re: #8 Buddy-List

Posted: Sat Mar 09, 2013 8:19 am
by Filip
My entry, pretty simple though, like #comathi's:

Entry

Re: #8 Buddy-List

Posted: Sat Mar 09, 2013 8:22 am
by Shim
Filip wrote:
My entry, pretty simple though, like #comathi's:

Entry
looks nice

Image

better if you hide the login text box and button when showing the buddies