官术网_书友最值得收藏!

Time for action - traversing the Graph

Set the Visualizer to start by requesting the PacktPub Page. Now, compile and run your SWF, and use the Connections box and the Pop Out buttons to explore the Graph, and see how far you can get. Don't forget you can drag Renderers around, and zoom out to fit even more in the Flash Player window! And remember, black lines signify connections, while gray lines signify that the object belongs to a List.

The following screenshot shows what it could look like after only a few clicks:

Time for action - traversing the Graph

You can already see the resemblance to the sprawling diagrams of the Graph seen previously in the chapter.

What just happened?

You've written the code to power an RIA that allows you to explore the entire public Graph, starting from any point. In other words, you've made a Facebook crawler, in Flash.

Have a go hero – exploring other areas

You don't have to start exploring from the PacktPub Page. Try changing that initial GraphRequest instance to request the Facebook Page, Facebook, or Mark Zuckerberg's public profile, markzuckerberg, or the Page of any other brand, company, or famous person.

Also, realize that you're not limited to a single GraphRequest; you can create as many as you like. Try starting with a few at once, and see if you come across any overlaps!

Keep an eye on your output window for traces telling you that a Graph Object or List could not be retrieved. Is it always for the same reason?

Pop Quiz

  1. What does the ?metadata=1 parameter do when used in a Graph API URL?

    a. It makes the metadata visible

    b. It makes the metadata invisible

  2. How many levels through the Graph can you traverse, starting with any Page?

    a. One

    b. Two

    c. Ten

    d. Unlimited

  3. True or false: If the JSON returned from a Graph URL contains an object called data, we can always assume it's a Graph List.

    a. True

    b. False

  4. True or false: If the JSON returned from a Graph URL doesn't contain an object called data, we can always assume it's a Graph Object.

    a. True

    b. False

主站蜘蛛池模板: 石嘴山市| 莱阳市| 闸北区| 吴旗县| 黄梅县| 应用必备| 长垣县| 娱乐| 马鞍山市| 绥芬河市| 凤翔县| 武宣县| 鹰潭市| 根河市| 揭西县| 北票市| 项城市| 柏乡县| 灵山县| 囊谦县| 高碑店市| 大姚县| 建阳市| 鹤山市| 巨野县| 泰来县| 寻乌县| 栖霞市| 高阳县| 景谷| 普定县| 揭东县| 额尔古纳市| 天台县| 枣阳市| 喀喇沁旗| 合作市| 鱼台县| 九江市| 丹凤县| 深水埗区|