Skip to content

Instantly share code, notes, and snippets.

@ZweiSteinSoft
Created June 23, 2012 20:07
Show Gist options
  • Save ZweiSteinSoft/2979762 to your computer and use it in GitHub Desktop.
Save ZweiSteinSoft/2979762 to your computer and use it in GitHub Desktop.
Twitter API entities: No lists support?

The Twitter API does not return lists as entities. Instead, the returned entity is the list owner only.

Tweet text

Here is a list: @mynetx/twcorp while the user is @echofon and the link is http://t.co/Bdx07zv.

Entities

The tweet entities are, according to API:

{
    entities: [
        {
            type: "user_mentions",
            value: {
                indices: [16, 23],
                id_str: "14648265",
                name: "J.M.",
                id: "14648265",
                screen_name: "mynetx"
            }
        },
        {
            type: "user_mentions",
            value: {
                indices: [49, 57],
                id_str: "58166411",
                name: "echofon",
                id: "58166411",
                screen_name: "echofon"
            }
        },
        {
            type: "urls",
            value: {
                indices: [74, 93],
                display_url: "google.com",
                expanded_url: "http://www.google.com",
                url: "http://t.co/Bdx07zv"
            }
        }
    ]
}

Question

Why does the entity #0 not look like this instead?

{
    entities: [
        {
            type: "list_mentions",
            value: {
                indices: [16, 30],
                "name": "twcorp",
                "full_name": "@mynetx/twcorp",
                "id_str": "64824337",
                "description": "Corporate Twitter accounts.",
                "mode": "public",
                "created_at": "Sun Feb 05 23:22:40 +0000 2012",
                "uri": "/mynetx/twcorp",
                "slug": "twcorp",
                "id": 64824337
            }
        }
    ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment