It should be possible to check that an entered username or list actually exists, and throw a validation error if not.

This should be configurable (disabled by default).

Comments

gapple’s picture

Issue in twitter_username.module for enabling this functionality: #1308018: Ensure accounts actually exists

Usernames can be checked with this api request:
http://api.twitter.com/1/users/lookup.json?screen_name=<username>

and will either return an object with an array of errors

{
    "errors": [
        {
            "code": 17,
            "message": "No user matches for specified terms"
        }
    ]
}

or an array of user objects (with a lot more data than this)

[
    {
        "id_str": "198707555",
        "id": 198707555,
        "screen_name": "gappleca",
    }
]
gapple’s picture

Looks like individual lists can be queried as well:
https://dev.twitter.com/docs/api/1/get/lists/show

gapple’s picture

I think the best route with the Twitter API set to require OAuth for version 1.1, is to integrate with twitter.module for checking validity rather than re-implementing authentication separately.