Project Llama for App.net (Alpha Release)

Engineered by: @ryantharp
Reference Implementation: @adrianus

Navigation: What | Getting Started | Clients | Categories | Suggestions | Contact
For Developers: Sample | FAQ | Suggested Uses | Helper API | Editing | Contact

Example User Annotation Sample

     {
        "data: {
          "annotations": [
            {
              "type": "iama"
              "value": {
                "iama": [Meat Popsicle]
              }
            },
            {
              "type": "iso"
              "value": {
                "iso": [Ghosts]
              }
            },
          ]
        }
      }
  
Back to top

FAQ

Well frequently may be once in this case, but here goes:

General

Would you consider moving this to its own domain?
I'm not sure why this would necessary but I would consider it given the proper reason. It's a user annotation format, so I don't think my site URL where I explain really matters.
What happens if you get hit by a bus? Or this site goes down permanently?
This project is designed so anyone can continue this project if I get hit by a bus. Right now, I do provide centralization for the master catalog of categories and tags. Though distribution of the catalog is done through file download, so this site's uptime isn't required for external application operation.

Helper API - Operational

Do I need the helper API?
There's nothing stopping a developer from providing their own helper API since all the data is stored on ADN in user annotations. My helper API just operates off a cache ADN user annotation data. Your app can be completely independent of my Helper API if you choose. Also when the ADN API releases the non-streaming filtering-API, the helper API will no longer be required.
Helper API Limitations?
Currently no limits on authentication or rate limiting. It's a bit early, we're still gauging interest. If we need limits we can add them later on. Though We'd like them to be based on actual usage pattern requirements and not arbitrary numbers. The real only limitation I have on the helper API is uptime (it's just a best effort SLA). For commercial apps that require more of the API, I have options please contact me.
How do you plan to scale the helper API? How will you support it monetarily?
Most of my projects' infrastructure costs are largely offset by my established economies of scale due to the fact I run a boutique hosting company. There is a limit of course I just doubt the rate of growth of any ADN projects will ever hit it.

Helper API - Technical

Are the categories a special top-level case to be aware of, or can it be a separate leaf?
There is no special cases. However, there is no limit on the nesting of categories.
Or is the master catalog sample below just some quick and easy snippets rather than a full representation of the schema?
quick and easy snippets yes. For a full sample: http://api.llama.adn.customwebapps.com/1/json/llama but only has English language labels so far.
Back to top

Suggested uses

For this information to be valueable for searching you must either have a cache of user annotations ready or use our provided API until App.net developers something more friendly to this task.
Search for specific tag
Find similar users
Back to top

Llama Helper API

Update 1/26/13 - Languages changed from ISO 639-1 to IETF language tags

To make use of this information with the current App.net API can be difficult. Currently the best way is to using the Filter API which currently only works with Streaming API. Another way to simplify search is to have your own database of current users annotations.

We realize not all developers will be using Streaming or have a cache handy, so we can composed a local cache with an API that you can off-load your searches too. We hope App.net will eventually update their API to make this an easier task in the future, not requiring 3rd party APIs like this.

We hope to bump version numbers on structural changes. However we may create (not delete) new keys (anywhere) without version increase unless a developer lets us know such a change will, in theory, break their design.

http://api.llama.adn.customwebapps.com/1/json/llama - Draft phase, requesting comments

Version 1! This will return the master json catalog of all categories and tags. This also provides the translation for each tag if available. Language may be omitted if translate is not available. Languages were choosed based on number of speakers and ADN usage.

Structure

There is two types of objects: categories and tags. For convienence, I've composed them both in a similar structure in hopes to make extraction and processing simple. The overall structure is an unlimited nested-tree of the following generic node structure:

  "NAMENODE": {
    "xlate": {
      "LANG":"STRING",
    }
    "cats": {
      LIST OF NODES,
    }
    "tags": {
      LIST OF NODES,
    }
  }
UPPERCASE denotes non-exact language (or variable if you will):
NAMENODE
is the "internal" label of the node (whether it's a category name or tag name). Only tag "internal" node labels are actually written to the user annotation.
LANG
is a IETF language tag (i.e. en-us)
STRING
is the translate label for that language
LIST OF NODES
is a list of nodes attached to this node.
The following keys explanation:
xlate
is the available translated strings of this node
cats
is the list of sub-categories of this node. This differentiates the category nodes from tag nodes.
tags
is the list of tags available in this node. This differentiates the tag nodes from category nodes.

Partial Example

I've tried to include a sample of a category, sub-category, and tag. I've also included the complete and paired down language listing styles. "..." is used to omitted large parts of unneeded data. I'm afraid if I make this example too big, it won't be able to be easily understood in one's browser. Best thing to do is get a real sample by going to the API URL.

{
  "data": [
    "Hobbies" : {
      "xlate": {
        "en-us":"Hobbies",
      }
      "cats": {
        "Activities" : {
          "tags": {
            "Camping" : {
              "xlate": {
                "en-us":"Camping",
              }
            },
          }
        },
        "Arts & Crafts" : {
            ...
        }
      }
    },
    ...
    "Networking" : {
      "tags": {
        "Business deals" : {
          "xlate": {
            "en-us":"Business deals"
          }
        }
      }
    }
  ]
}

http://api.llama.adn.customwebapps.com/0/json/users/llama/min/X/urlencoded list of comma separated tags

This will return a list of user IDs and number of matches that have X or more of the provided tags set in their "iama" annotation

Example

http://api.llama.adn.customwebapps.com/0/json/users/llama/min/1/Ghosts,Meat+Popsicle
"data": [
  {
    "7314",2
  },
  {
    "7428",1
  }
]
You can use the ids to pull additional information about the user (Retrieving multiple users using App.net API)

http://api.llama.adn.customwebapps.com/0/json/users/llama/max/X/urlencoded list of comma separated tags

This will return a list of complete user objects that have X or more of the provided tags set in their "iama" annotation. This is not bandwidth efficient but may reduce the need for extra calls reducing latency.

Example

http://api.llama.adn.customwebapps.com/0/json/users/llama/max/1/PHP,Javascript
"data": [
  {
    "annotations" : [
      {
        "type" : "iama",
        "value" : {
          "iama" : [
            "Dining Out",
            "C",
            "C++",
            "CSS",
            "HTML",
            "Javascript",
            "PHP",
            "VB",
            "Business deals",
            "Career opportunities",
            "Consulting offers",
            "Expertise requests",
            "Getting back in touch",
            "Job inquiries",
            "New ventures",
            "Reference requests"
          ]
        }
      }
    ],
    "avatar_image" : {
      "height" : 200,
      "url" : "https://d2rfichhc2fb9n.cloudfront.net/image/4/Kd_yDqphsKyOuzr3NP2g3-VxdwJ3xFTt3KWLD6Nhc4AG_sNzd2UAWWcXQmoG-Zb5AaMKW-KHxp6UhgYZg-C2LwGVoU_AuE1BlX60SGKSx4B3mm_rxM72d_33gTOsgLomC-1LP-c0Fwp0jtosDgmHExN6BLM",
      "width" : 200
    },
    "canonical_url" : "https://alpha.app.net/ryantharp",
    "counts" : {
      "followers" : 176,
      "following" : 369,
      "posts" : 3776,
      "stars" : 89
    },
    "cover_image" : {
      "height" : 606,
      "url" : "https://d2rfichhc2fb9n.cloudfront.net/image/4/ESjU2hqqXlTBmkJ8N8hL9-gaRiuNxP2PTHF_JkdrxN3HG7NNCx55DqIItHyA6pnn7Hc4u4QXZgpPcDEKxSMxf1eMJteZI7ndxQ4kqnxuk1rV6hVHtLP9rt7ngBIQvjuFcFM8BCpfOqz_YPNI5UVB-jEcIZU",
      "width" : 1900
    },
    "created_at" : "2012-08-17T23:55:35Z",
    "description" : {
      "entities" : {
        "hashtags" : [],
        "links" : [
          {
            "len" : 24,
            "pos" : 81,
            "text" : "http://CustomWebApps.com",
            "url" : "http://CustomWebApps.com"
          },
          {
            "len" : 29,
            "pos" : 227,
            "text" : "http://adn.customwebapps.com/",
            "url" : "http://adn.customwebapps.com/"
          }
        ],
        "mentions" : []
      },
      "html" : "I'm Ryan Tharp. I'm an entrepreneur and full stack developer in the North Bay at http://CustomWebApps.com. I also have a flare for game development (currently using: webgl, websockets). Find out about me and my ADN projects at http://adn.customwebapps.com/",
      "text" : "I'm Ryan Tharp. I'm an entrepreneur and full stack developer in the North Bay at http://CustomWebApps.com. I also have a flare for game development (currently using: webgl, websockets). Find out about me and my ADN projects at http://adn.customwebapps.com/"
    },
    "id" : "7314", // note this is a string
    "locale" : "en_US",
    "name" : "Ryan Tharp",
    "timezone" : "America/Los_Angeles",
    "type" : "human",
    "username" : "ryantharp",
    "matches": 3
  },
  {
    "annotations" : [
      {
        "type" : "net.app.core.directory.twitter",
        "value" : {
          "username" : "hisrandomness"
        }
      },
      {
        "type" : "net.app.core.directory.homepage",
        "value" : {
          "url" : "http://appnetizens.com"
        }
      },
      {
        "type" : "com.appnetizens.userinput.country",
        "value" : {
          "country" : "NL"
        }
      },
      {
        "type" : "com.appnetizens.userinput.gender",
        "value" : {
          "gender" : "m"
        }
      },
      {
        "type" : "net.app.core.directory.blog",
        "value" : {
          "url" : "http://appnetizens.com"
        }
      },
      {
        "type" : "com.appnetizens.userinput.nationality",
        "value" : {
          "nationality" : "NL"
        }
      },
      {
        "type" : "iama",
        "value" : {
          "iama" : [
            "Camping",
            "Dining Out",
            "Fishing",
            "PHP",
            "Reference requests"
          ]
        }
      }
    ],
    "avatar_image" : {
      "height" : 189,
      "url" : "https://d2rfichhc2fb9n.cloudfront.net/image/4/Q4W-_7Xs8Befd311Y02k5c7jlpVTdlpOVjkfU9M2O1pytZQR9g6uuz9I8lEhFCiyFiZrXMKVvu9pxwX3KZJfkJye3xAiP_eTZBqTivhFkQpi0SWhUDSLYbpLwt2QnSiVgtw-OmBhF_AFG5did66KHOODGak",
      "width" : 189
    },
    "canonical_url" : "https://alpha.app.net/adrianus",
    "counts" : {
      "followers" : 322,
      "following" : 183,
      "posts" : 3674,
      "stars" : 34
    },
    "cover_image" : {
      "height" : 434,
      "url" : "https://d2rfichhc2fb9n.cloudfront.net/image/4/oe3PvS0WlqUcbw2ubf06jshoJjt88r7O4rTr704Hbs6VN7M2bsIfXohohWn5ZdiQw0EPlbcS9XYbqlQTdnotZXJgWB-fB_ZqPL1W4Yr_kd693rDx_Qv50lV4mOFxdX6eUNy6ONKaF-Wzp3pL3TtEeAtjN1g",
      "width" : 1357
    },
    "created_at" : "2012-08-18T00:04:53Z",
    "description" : {
      "entities" : {
        "hashtags" : [
          {
            "len" : 3,
            "name" : "nl",
            "pos" : 156
          }
        ],
        "links" : [
          {
            "len" : 22,
            "pos" : 114,
            "text" : "http://appnetizens.com",
            "url" : "http://appnetizens.com"
          }
        ],
        "mentions" : []
      },
      "html" : "Investor / CFO / Derivator / Analyst / Likes to fiddle around with data and API's. I take full responsibility for http://appnetizens.com Based in Amsterdam #nl",
      "text" : "Investor / CFO / Derivator / Analyst / Likes to fiddle around with data and API's. I take full responsibility for http://appnetizens.com Based in Amsterdam #nl"
    },
    "id" : "7428",
    "locale" : "nl_NL",
    "name" : "Adrianus Wagemakers",
    "timezone" : "Europe/Amsterdam",
    "type" : "human",
    "username" : "adrianus",
    "matches": 2
  }
]

http://api.llama.adn.customwebapps.com/0/json/users/USERID/updated

If you app makes changes to the user ISO or IAMA annotations, we ask that you ping this URL with the USERID, so we can update our search cache. Will return a 2XX http code on success.

http://api.llama.adn.customwebapps.com/0/json/llama

Obselete. This will return the master json catalog of all categories and tags

Example

{
  "Hobbies" : {
    "Activities" : {
      "Camping" : "Camping",
      "Dining Out" : "Dining Out",
      "Fishing" : "Fishing",
      "Hunting" : "Hunting"
     },
    "Arts & Crafts" : {
      ...
    }
  },
  ...
  "Networking" : {
    "Business deals" : "Business deals",
    "Career opportunities" : "Career opportunities",
    "Consulting offers" : "Consulting offers",
    "Expertise requests" : "Expertise requests",
    "Getting back in touch" : "Getting back in touch",
    "Job inquiries" : "Job inquiries",
    "New ventures" : "New ventures",
    "Reference requests" : "Reference requests"
  }
}
If you use our APIs, please check back with this page for updates peridotically.
Back to top

Thoughts about implementing editors

Download latest master json file - URL updated! 12/7/12

Initially we choose a string-based value to keep things simple. There is a concern about the limited space available. So I'm requesting implementation that write to these annotations be respectful:

We are going to publish a master JSON categories and tag document. So all implementations will have a standard set of categories tags to increase the chances of finding matches and utilizing the space efficiently as possible. I figure the JSON format is best due to the ADN API using it as well.

We realize if we're publishing a categories and tag dictionary, we might consider switch to a numeric-based tag and including the numerical equivalents in this JSON dictionary file to save even more space. We don't initial do this because we're focusing on adoption. The simpler we make this for developers, the more client's that can utilize it. But it is something that is on the table if we can't solve the space issues

Back to top

Contact & Support

Commercial support, higher availability, SSL encryption, and more advanced matching APIs are also available for the Llama API, contact us for more information

contact @ryantharp on ADN, if you have any comments, questions, feedback.

Contact Form: Back to top