This article was what I started with. But mimicking the hashing algorithm developed by Bob Jenkins from C# to ActionScript was not a good idea that my deadlines could allow.
I still Googled and fortunately found this one. Here is a summary of the article from Louis Lee (not sure he's the original author).
- Download FetchPR.as
- Add it to your project.
- Initialize the FetchPR’s instance.
- Set the callback function of FetchPR
- Call FetchPR’s getPR function to get a url’s PR.
import scripts.FetchPR;
import mx.managers.CursorManager;
private var fetchprinstance:FetchPR = new FetchPR();
private function getPageRank():void
{
CursorManager.setBusyCursor();
fetchprinstance.callback = setResult;
fetchprinstance.getPR(urlbox.text);
}
public function setResult(pr:Number):void
{
result.text = "PageRank is: " + pr.toString();
CursorManager.removeBusyCursor();
}
No comments:
Post a Comment