Categories
Geeky/Programming Life

Cool Things I Have Been Doing On the Computer Lately

In the past couple of months, weeks, whatever (time flies) I have been doing some pretty cool things on the computer, in a wide range of areas. Just want to get them down on paper (you know what I mean)…

1. Yammer – working hard on growing Yammer community, external networks, just getting engagement and showing the benefits. It’s fun.

2. Kinect – did some Kinect hacking. On my own then with the group, got some cool stuff to show. It is crazy how easy it is to get something up and running with Kinect and the SDK. I see this stuff taking off in the coming months/years.

3. Azure – dorking around with Azure, looking at what it can and can’t do, what it could do well, how it would fit in with everything.

4. SQL 2012/Power View – been playing around with SQL 2012 since “Denali”, but now its got an official launch date (March 7th) and things are getting real. Power View demos online, trying to figure out how SQL 2012 is going to fit into our infrastructure and just learning as much as I can about it.

5. Ruby – been getting into Ruby and Ruby on Rails on my Mac, git, sqlite3, heroku, etc. Trying to learn more things that just the .NET ecosystem.

6. Ubuntu – same here, set up a VM, been trying to use it consistently, trying to get the other viewpoints from Windows and Mac and where things are at. Keep up with the joneses so to speak.

7. Android – I picked up a Samsung Galaxy (Verizon 4G) a few weeks ago and have been using it. I still love my iPhone, but getting more into Android. Ice Cream Sandwich (ICS) is a pretty good OS, there are still quirks, but its better. Verizon sucks around where I live btw.

8. Google+/Picasa Web Albums – been getting this into my photo workflow, for sharing and backup. Liking it so far.

9. SharePoint 2010/FAST – been researching and reading FAST server like crazy trying to see how it will fit in with a potential project. I think it could be amazing. more to come.

10. SMS – been playing around with different frameworks, and seeing how they compare, trying things out. Using Voice and SMS is all the rage these days. (Hall and Oates thing anyone?)

Bonus: Nothing with computers, but I have been really getting into brewing beer/homebrewing. I think we have made 5 batches now, and the ones I have tasted so far are really good. It is a fun hobby and breaks up the constant technology I am involved in. More to come here too.

And much much more. Time is limited, time to post is limited. Getting out there and doing cool things is fun, and sharing them is fun too. Gotta find the right balance. I hope everyone is having a cool 2012 so far.

Categories
Geeky/Programming

Fun with the Facebook Graph API

Lazy Sunday afternoon, so I decided to dig a bit into the Facebook Graph API. What is the FB Graph API? Well it allows you to create an application and use OAuth to connect and then get information about yourself and your friends and do things in Facebook using JSON objects and requests. Easy way to read/write from Facebook.

But, the kicker seems to be getting things started. To start, Facebook has documentation and links and wikis all over the place, so it is hard to get a handle on what you want or need to do.

First you need to create an application. Once you do that you need to set up some things so you can actually use Facebook data.

Once you have that done, you can see your apps here

You will want to take note of a few things and change some settings..First might be to put your app in “sandbox” mode:

Also, under “Authentication” you might want to change Authentication Callback URLs.. and then under “Connect” change your “Connect URL”, and you want it in form http://blah.com/

So to test your app and see what you can do, you need to know your

ApplicationId
API Key
Secret

now, you can make unauthenticated calls to the Graph API, try it..

https://graph.facebook.com/56011561

That’s me. You should be able to see public info on me (don’t try it in IE, it pukes.. Chrome it was working. You might need to be logged into FB)

Anyways, if you want your app to be able to get more than the “public” unauthorized view, you need to make some calls and get some access tokens..

First you need to get an “access code”

https://graph.facebook.com/oauth/authorize?client_id=&redirect_uri=&scope=user_photos,email,user_birthday,user_online_presence,offline_access,friends_birthday,friends_education_history,friends_hometown,friends_location,friends_relationships,friends_religion_politics,friends_likes,friends_interests,friends_groups

You can see in that URL, you have to supply your app id, and your redirect url. Keep it simple, your redirect url should be something like http://blah.com/ .. don’t have querystring params..

If you have things set up, facebook should authenticate you, and ask you to allow your app to have permissions to pretty much “EVERYTHING” on your profile and friends info. To see what “extended permissions” you can use, see here: http://developers.facebook.com/docs/authentication/permissions

You *should* get redirect to your redirect_url with a param in the url called code=

Grab that code, you will need it.

Now to get the access_token

https://graph.facebook.com/oauth/access_token?client_id=&redirect_uri=&client_secret=&code=

once you hit the above URL, with the code from step one you will get an access token

take that token, and then try

https://graph.facebook.com/me?access_token=

you can also get your friends ids

https://graph.facebook.com/me/friends?access_token=

Once you get your friends list, you can use their id's and get info back from the graph.

If you get errors or did something wrong, you might have screwed up your first requests. There are sites and forums saying to add type=client_cred - don't do that, it doesn't work. It will give you a shorter access token, which doesn't work.

Once you have all that working *MANUALLY*, then check out Facebook's officall C# sdk for the graph - http://github.com/facebook/csharp-sdk

Basically then you can replace the access token there with your token and test things.

Then just tie it all together in an app so you can do it programatically, but that is for another blog post 🙂