Moved…

November 21, 2011

I’ve moved this over to http://www.salpy.ca/blog/ Any updates (if any) will be seen there.

Sharing in Facebook without meta tags on your page

October 7, 2011

Typically when you decide to share a link on Facebook it reads through the meta tags on the page the link points to in order to obtain thumbnails and other information to display in the post. Unfortunately it’s hard to meta tag each and every HTML page if you a) have a flash site or b) a site where everything is being generated on the fly – e.g. everything runs off of index.php

After much digging (I take no credit for this) the following JavaScript based share allows you to specify everything for your share:

function shareFacebook(title,summary,image, link){
http://www.facebook.com/share.php?s=100&p[title]=”+encodeURI(title)+”&p[summary]=”+encodeURI(summary)+”&p[images][0]=”+encodeURI(image)+”&p[images][1]=”+encodeURI(image)+”&p[url]=”+encodeURI(link)
}

For some reason if you need to share one thumbnail, you need to specify images at index 0 & 1. For more thumbs, just continue to add more images to the [images] array.

RIM – my 2 cents on what’s so wrong

June 16, 2011

Reading through a business article today, this quote stood out for me “some of the analysts were loudly wondering just when Mr. Balsillie and his co-CEO, Mike Lazaridis, would step aside and hand the reins to someone else.” Now I’m not a business person, but I do work with various tablet devices as part of my job. As one of the developers out there to receive a “free” PlayBook, here’s my critique on what went wrong.

When I received my PlayBook I couldn’t help but notice the glaringly bad looking green loading circle. Why in the world does it look like someone cropped out a poor resolution gif and animated it? Also, why doesn’t it match the feel of any of the other components? Already, one point against RIM. Next up, poor user experience. As I’m trying too add someone to my chat the keyboard slides up for me to enter their name, as it slides away it shows a button under the text field which I assume is the submit or done button. Boy was I wrong, that’s the CANCEL button, the next button is for some reason up in the top left corner in a completely different section of the screen. This goes against all intuition on how to navigate a device. Then again, should I be surprised? RIM’s traditional software is one of the most unintuitive things I’ve ever seen.

What I don’t understand is why RIM farmed out core pieces of its PlayBook software to various developers. When your main competition is Apple, a company known for having a strong focus on design and user experience, why in the world would you not hire an inside team to make sure everything was done consistently, properly, and with a high level of polish? Users aren’t engineers! They don’t care what the device has inside of it if they can’t use it. If RIM’s decision to parcel out software development of their core PlayBook applications was for cost reasons, they would have been much better off cutting their CEO’s and CFO’s salaries a tad and invested wisely in an in house team. Though RIM’s products seems innovative and great in the late 90s, they can’t claim the same now when they are faced with a sea of competition that actually pays attention to the user.

FaceBOOOOk!

April 29, 2011

Facebook pain strikes again. An older app of mine was stuck in an endless refresh loop that I couldn’t figure out for the life of me. Seems that when Facebook moved to their new signed_request stuff, they didn’t bother changing settings for older apps.

Seems that you need to go into your app settings and select a new option for OAuth 2.0 for Canvas
“Select on “OAuth 2.0 for Canvas” in Edit application settings->Advanced”

That fixed it for me. Here’s the forum thread:

http://forum.developers.facebook.net/viewtopic.php?id=96342

In other news, I couldn’t get a signed_request in a tab page all because when I typed in the link for the tab in the app settings, I forgot the slash at the end. http://myapp.domain.com/tab doesn’t work. http://myapp.domain.com/tab/ does! *smacks forehead*

The Wildly Inconsistent Facebook

April 8, 2011

When developing for Facebook, you’re bound to run into issues you would never dream of because they are inherently problems within their system. What follows is a laundry list of issues I’ve ran into, mostly with the graph API, that have caused many wasted hours and many rage / swear filled minutes: Read the rest of this entry »

Fixing fonts not rendering in Flash Builder

April 1, 2011

Ok. So you may know of the additional compiler argument -managers=flash.fonts.AFEFontManager  to fix the “my font doesn’t show up” problem.  Flash Builder has multiple font managers, some being much better than others. For those of you who are as lazy as I am, here’s a way to make sure it always defaults to the right font manager.

Look for the file flex-config.xml under “Adobe Flash Builder 4\sdks\4.0.0\frameworks” . You might have to ensure you have read/write permissions for the user when in windows before you try editing this file. Look for “managers” and you’ll find a list that looks like this:
<!– Compiler font manager classes, in policy resolution order–>
<managers>
<manager-class>flash.fonts.JREFontManager</manager-class>
<manager-class>flash.fonts.BatikFontManager</manager-class>
<manager-class>flash.fonts.CFFFontManager</manager-class>
<manager-class>flash.fonts.AFEFontManager</manager-class>
</managers>

Make sure the AFEFontManager is the LAST one in the list. For some reason Flash Builder works backwards for finding font managers.

Save and restart Flash Builder.

Getting around the Facebook bottleneck that is the graph API

March 25, 2011

Recently we had a client who wanted a Facebook application that revolved around fetching the recent status of all the user’s friends. Since the graph API has a user connection named statuses (https://graph.facebook.com/{user_id}/statuses) , I figured this wouldn’t be much of a problem. What I didn’t think of was the limit Facebook places on the number of simultaneous calls to the graph API. For a user with approximately a hundred friends, it would take up to two minutes to load their most recent status. Obviously this wasn’t going to work since no one wants to stare at a loader for that long. The solution: Facebook’s Query Language (fql) — SQL like calls that allow to to grab data exposed by the graph API.

For those of you who just want the query without getting into the rest of the code, here it is:

SELECT status,uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1= me())
AND (strlen(status.message) > 0) ORDER BY status.time DESC

Breaking it down:

  • The SELECT uid2 FROM friend WHERE uid1=me() bit grabs your list of friends. Essentially you’re querying the
    friend table and selecting users (uid2) who are friends with the current user (uid1).
  • Looking at the start of this query: SELECT status,uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1= me()) says to grab the status and user id (uid) from the user table where the user exists in your friends list.
  • So far we’ve grabbed the user id and current status for all the user’s friends. Since the status table is limited to the last 30 days, you might get some empty results. To filter these out we check if the message column in the table has an entry that is longer than zero characters with: AND (strlen(status.message) > 0)
  • Finally we are ordering the statuses by most recent date to oldest with: ORDER BY status.time DESC

We’re only using data from the uid, time and message columns of the status table, but there are a couple more columns you can gather information from :

  • uid: id of the user who posted the message
  • status_id: id of the status message
  • time: time in seconds that has elapsed from January 1 1970 (Note: seconds, NOT milliseconds)
  • source: the application that posted the status originally
  • message: the status text
Source http://developers.facebook.com/docs/reference/fql/status/

That’s all for the actual fql call. The next two sections will show how to execute the call and how to import that data into flash in an easily readable format. Read the rest of this entry »

Moving towards code

March 25, 2011

This blog had started as a multimedia blog while I was in school, but that was a couple years ago and I figure it’s time to start blogging about what I actually do work wise — actionscript 3 mostly.


Follow

Get every new post delivered to your Inbox.