Posts Tagged Yahoo
Well it’s been out for a while now, but not all the parts were there so I didn’t want to talk about it. Now that it is complete, I can. This is my second project I did at B-Reel and probably the biggest I ever did. I would be very curious to know the number of lines of code in this project, I am sure it would be pretty high. I wish I could find an Eclipse tool for that. Anyway, very cool site, very nice videos and a fun set of tools (you can’t use the SmackTalk one unless you play in Yahoo! fantasy football, but you can use the others). Check it out:
So after playing with Twitter OAuth, I played with Yahoo!’s and now Facebook. So seems like OAuth is the new cool kid in town.
Using the OAuth AS3 library
Also, the oauth-as3 library is relying on the class mx.utils.UIDUtil to generate a unique identifier as a parameter for one of the request. As you can see from the mx prefix, this requires that you compile the Flex framework with your project. Which is kinda a bummer since it is the only dependency to Flex. I found this class on the RGBBlog that provide the same functionality but without requiring Flex. I had to tweak it a bit because it is not really made as a library (it doesn’t have a package and extends Sprite) and I have made it available for download here.
Facebook and OAuth 2.0
So during April 2010, Facebook announced the Open Graph and with it a whole new API but also a new way to authenticate and authorize. It was to use OAuth 2.0, which is a version of OAuth that is still a draft. Well all we learned before (OAuth 1.0) kinda doesn’t work here anymore. But OAuth 2.0 is a bit simpler, supposedly requires less exchanges. This is all cool and all, but Facebook sticks to its guns and provide shitty documentation about the process; well half shitty, they provide good documentation for half of the process but for the other part it is as if the guy was tired of writing documentation and wrapped it up very quickly, leaving us without enough clear information to implement it.
//This makes sure that the crossdomain policy is read and you can access the profile picture Security.loadPolicyFile("http://profile.ak.fbcdn.net/crossdomain.xml");
Also know that if you add that line of code twice, you are going to crash the Flash Player. For this library to work your application in Facebook must absolutely be set as a desktop application.
So that pretty much sums up what I have been doing with OAuth.
As some of you might know, on August 16th 2010 (it was June 30th at first, but they moved it because of the World cup), Twitter will be shutting down its basic authorization in favor of OAuth. Well Facebook also announced that they would be soon using OAuth. Google and Yahoo! use it too. Looks like it is a good time to learn it.
OAuth, contrary to what some might say is not that easy of a process. It involves a couple more steps than basic authorization. But what it gains from that is trust. The user never has to enter its username and password on your site. My problem with it is that I find that it breaks the user experience because it usually redirects the user’s browser to the website of which you want to use the API, so that the user can input its credentials and that they can allow your application to use data from the API. If you are not familiar with OAuth, here is a great beginner’s guide.
Here is a picture of all the steps involved in the process:
Now what I wanted to write about was the twitteroauth library for PHP by @abraham. I tried to try the other OAuth PHP library that is listed in the Twitter documentation but I couldn’t figure out anything; they talk about Two-Legged OAuth and Three-Legged OAuth, but I have never seen that anywhere. twitteroauth on the other hand is pretty simple to understand. By reading the documentation and starting with the example provided in the source code, I was able to implement what I wanted.
Now I wasn’t the one who created the application on Twitter (which you have to do before you get started with code), so there was a couple of settings that weren’t right at first. You can set if you want your application to be Read-only or Read & Write. Obviously if you want to send Tweets using your application, you will need it to be set to Read & Write. Also in order to use this library you must set your application as a Browser application (as opposed to Client which will not work). I just thought it would be good to list those here so that others (and I) don’t spend the half hour I lost trying to figure this out.
Here is another really interesting tidbit: once you create an authorization token, Twitter will never destroy it. This is not the same for all APIs (I know Yahoo! will expire the token after some time). So once you lead the user through all of the OAuth steps, you can keep the token and use it forever so that the user don’t have to go through the steps again, which is very useful for mobile and desktop apps. It also opens up possibilities for other stuff too, which I will show you eventually, if my current project ever finishes.
Well that is is for now, there will be more on OAuth soon as my next project also connect to another API that uses OAuth.
It’s a pretty shocking title with all the fuss about the new flash player for Google and Yahoo, but I will try to explain why I came to this conclusion. I suggest you read about the seven test cases I did because that’s mostly what my reasoning is built on. I am going to explain point by point what happened in the experiment.
My first test case was simply to put static text right on the first frame of the swf file. That’s all this flash file contained. If you search in Google for the unique expression contained in that static text, you will find the specific html embedding the swf, meaning that the content was indexed.
The second test case was similar to the first one except that instead of being a static textfield on the stage, it’s a prefilled dynamic textfield (meaning the text in the textfield was added using the Flash IDE not ActionScript). Again for this case if you search the unique expression, the good html page will come up (As for the first case, you see in the description in Google for that link the extract of text containing the expression furthermore proving that the content was indexed).
The third test case was also a dynamic textfield, but the text in it was added using ActionScript. The page is indexed in Google (do a search for ‘site:www.fleximagically-searchable.com “fleximagically searchable”‘ and click “repeat the search with the omitted results included” at the bottom of the page to see all test case indexed) but the content doesn’t show in the description of the link. Also if you did a search for the unique expression nothing relevant would come up.
The fourth test case, the last done in Flash, was a static textfield inside a Sprite added to the stage using ActionScript. Again for this case the html page is indexed, but none of the Flash content is.
The fifth test case, as all of the next test cases, was done in Flex, it’s a TextArea component in mxml filled with the text attribute in the mxml, so no ActionScript involved. In this case, if you search for the unique expression you will see that the content inside the swf is indexed, proof that some content in Flex can be indexed.
The sixth test case is a Label component in mxml filled with the text attribute int the mxml. In this case, the content didn’t show up on Google, so I guess not all components are indexable.
Lastly, the seventh test case is a Text component in mxml filled with content using the text attribute in the mxml. I think this case is really similar to the second test case; a dynamic textfield in Flash prefilled with content. In this case, the content showed up on Google, so the swf was indexed.
From this SEO experiment, we see that static textfields on the timeline, prefilled dynamic textfields and some basic Flex components (TextArea, Text) in mxml are indexed by Google. It seems to me that as soon as there is ActionScript involved to change the content, that content will not be indexed. If you look back a bit, you kinda see that Google doesn’t use any new Flash player to index swf files, it does what it always was doing; nothing new. If somebody has a proof of dynamic content being indexed by the new player I’d be glad to see it, but for now I am assuming that Google is not using the new player given by Adobe.
This brings us to the Flex Seo contest, where my Fleximagically Searchable entry is performing well, but my content is not indexed. My take is that this contest will be pretty hard to win. There might still be possibilities to make this work but I think they are a bit too far fetched. Here is what I think might still have some chances: I did all my experiments with ActionScript 3 and I believe from the results that you cannot win using ActionScript 3. Where there could still be some opportunities would be if the swf generated would be using ActionScript 2 (which would use the flash player virtual machine 1), so in order to win the contest, you would have to build your Flex application in Flex 1.5 or even before. This would mean that the new special flash player for Google would only work for Flash 8 and below. I really hope it is not the case and that it is just that Google is not using the special player yet.
Another way to win would be that Google roll out the new player before September which is the ending date of the contest. Let’s hope they do so!
From previous posts you know that I am participating in the Flex SEO contest. I got my page pretty high on Google, but it still doesn’t seem to be finding my content. There are still a lot of unknown about this new SEO technology that Adobe, Google and Yahoo worked on and I think that to make a Flex application that load the content dynamically is to go a bit too fast.
So with that in mind I made simpler swf files. I even made some using Flash to see what would get indexed and how. In each of my experiments I have included a unique search expression basically formed from Fleximagically Searchable plus another word. If you search Google with that expression and one of my experiment shows up, it means Google indexed the content. Here are my experiments:
We don’t even know what type of swf is or is not indexed by Google so I sat down down and I made the simplest ones. Since Flex is pretty complex, I made some files using Flash.
The first one is only a static textfield right on the timeline. we know Google used to index those files, let’s see how it does it.
The second one is still in Flash using a prefilled dynamic textfield.
The third one is using a dynamic textfield again filled using ActionScript.
The fourth one is using a static textfield added to the stage using ActionScript.
Since we don’t know if Flex files get indexed at all, I made three simple experiments using basic components: TextArea, Label, Text. In those experiments the content is filled using the text attribute in the MXML file.
Flex file using TextArea.
Flex file using Label.
Flex file using Text.
Now let’s wait for Google to crawl these pages and then we will be able to better understand how this all works.