Editer le texte de cette page (date de la dernière modification: 7 Avril, 2007 15:23 (diff))
*info: cette page est réservé aux geeks et recense ce qui a trait à l'API officielle et aux documentations non officielles. Le TwitterFanClub ne pourra être tenu responsable de rien sur l'utilisation de ces informations restant à vérifier. Seul le ![]() Les docs de l'API officielle sont posées sur ![]() ![]() [[toc]index] ==== Docs API Non officielles = <html> <ul> <li><a href="#PubliclyAvailableCommands">Publicly Available Commands</a> <ul> <li><a href="#publictimeline">public timeline</a></li> </ul> </li> <li><a href="#Authorization">Authorization</a> <ul> <li><a href="#BasicAuthorization">Basic Authorization</a></li> <li><a href="#LoginAuthorization">Login Authorization</a></li> </ul> </li> <li><a href="#AuthorizedCommands">Authorized Commands</a> <ul> <li><a href="#usertimeline">user timeline</a></li> <li><a href="#friendstimeline">friends timeline</a></li> <li><a href="#friends">friends</a></li> <li><a href="#followers">followers</a></li> <li><a href="#update">update</a></li> <li><a href="#accountsettings">account settings</a></li> </ul> </li> <li><a href="#ResponseTypes">Response Types</a> <ul> <li><a href="#StatusResponses">Status Responses</a></li> <li><a href="#UserResponses">User Responses</a></li> </ul> </li> <li><a href="#RequestHeaders">Request Headers</a></li> <li><a href="#Conventions">Conventions</a></li> </ul> <!-- As the wiki add br tags, I had to compress the linebreaks as above. Use this to edit the TOC: <ul> <li><a href="#PubliclyAvailableCommands">Publicly Available Commands</a> <ul> <li><a href="#publictimeline">public timeline</a></li> </ul> </li> <li><a href="#Authorization">Authorization</a> <ul> <li><a href="#BasicAuthorization">Basic Authorization</a></li> <li><a href="#LoginAuthorization">Login Authorization</a></li> </ul> </li> <li><a href="#AuthorizedCommands">Authorized Commands</a> <ul> <li><a href="#usertimeline">user timeline</a></li> <li><a href="#friendstimeline">friends timeline</a></li> <li><a href="#friends">friends</a></li> <li><a href="#followers">followers</a></li> <li><a href="#update">update</a></li> <li><a href="#accountsettings">account settings</a></li> </ul> </li> <li><a href="#ResponseTypes">Response Types</a> <ul> <li><a href="#StatusResponses">Status Responses</a></li> <li><a href="#UserResponses">User Responses</a></li> </ul> </li> <li><a href="#RequestHeaders">Request Headers</a></li> <li><a href="#Conventions">Conventions</a></li> </ul> --> </html> ==== Commandes Publiquement Disponibles = ===== ligne de temps publique (public timeline) = La ligne de temps publique peut être retrouvée sour JSON, XML, RSS et ATOM à partir des URLs suivantes : * ![]() * ![]() * ![]() * ![]() Ce fail renverra toujours (actuellement) les 20 derniers billets. Néanmoins la suggestion d'un paramètre 'count' a été soulevée. par ex : ![]() **Response type:** status ===== Authorization Il existe actuellement deux options pour l'autorisation : # Basic Authorization # Login Authorization et gestionnaire cookie de session Les deux ont besoin de bonnaître le nomutilisateur de l'utilisateur et son mot de passe. ====== Autorisation Basique = L'autorisation basique est produire via n'importe quelle méthode requise par votre librairie. Ce pourrait être l'utilisation simple d'une URL telle que : ![]() Toute autre implémentation d'autorisation basique devrait référer aux librairies WWW de votre langage de programmation. **Response type:** N/A - This auth type is used with any command. A 401 status indicates a failed auth. ====== Login Autorisation Avertissement : Ce n'est pas une commande officielle API. Vous recevrez une réponse text/html. Vous aurez besoin de parser cela pour déterminer le succès/échec. Il n'existe aucune garantie que Twitter ![]() Si vous préférez, vous pouvez utiliser un gestionnaire de cookie pour connecter via l'autorisation du site web. Envoyez une requête POST à ![]() **Response type:** html ===== Commandes Autorisées = Ce commandes sont uniquement disponibles pour les utilisateurs qui se sont connectés comme au-dessus ===== <code>user timeline</code> = This command returns the authorized user's timeline. The following URLs require no extra parameters: * ![]() * ![]() * ![]() * ![]() **Response type:** status ===== <code>friends timeline</code> = This command returns the authorized user's friends timeline (friends include the authorized user). The following URLs require no extra parameters: * ![]() * ![]() * ![]() * ![]() **Response type:** status ===== <code>friends</code> = This command returns the authorized user and their friends' current status. *Not* a timeline, just the latest entry: * ![]() * ![]() * -<raw> ![]() * -<raw> ![]() **Response type:** user NOTE: 2007-03-21: This appears not to be working for RSS or ATOM ===== <code>followers</code> = This command returns the authorized user's followers' current status. Once again, *not* a timeline, just the latest entry: * ![]() * ![]() * -<raw> ![]() * -<raw> ![]() **Response type:** user NOTE: 2007-03-21: This appears not to be working for RSS or ATOM ===== <code>update</code> = This command allow you to set the authorized user's status. Send a POST request to the following URLs with the '<code>status</code>' parameter set to the new status. Don't forget to URL-encode the status if you library doesn't do it for you. * ![]() * ![]() **Response type:** null ===== <code>account settings</code> = NOTE: This is not an official API command. You will receive a text/html response. You will need to parse that to determine success/failure. There is no guarantee Twitter ![]() This command allows you to set various account settings for the authorized user. Send a POST to the following URL: * ![]() The following parameter names should be self explanatory. Don't forget to URL Encode both the parameter name and value if your library doesn't handle that for you automatically. * <code><raw>user[name]</raw></code> -- Only letters, numbers and underscores (_) are allowed * <code><raw>user[email]</raw></code> * <code><raw>user[time zone]</raw></code> -- See the website source for a list of accepted values * <code><raw>user[url]</raw></code> * <code><raw>user[description]</raw></code> -- Up to 160 characters only. * <code><raw>user[location]</raw></code> * <code><raw>user[protected]</raw></code> -- 1 or 0 **Response type:** html ==== Types de Réponses = ===== Réponses Status = Ce réponse sont en réponse pour les requêtes de type timeline. Champs renvoyés : <html> <table style="width: 100%"> <tr><th>Field Path</th><th>Data format</th><th>Example</th></tr> <tr><td><code>created at</code></td><td>HTTP Format date</td><td>Tue Mar 13 00:12:41 +0000 2007</td></tr> <tr><td><code>text</code></td><td>Up to 160 characters of utf8</td><td>Creating this table</td></tr> <tr><td><code>id</code></td><td>Integer</td><td>123</td></tr> <tr><td><code>user.name</code></td><td>Up to 40 characters of utf8</td><td>Rick Measham</td></tr> <tr><td><code>user.description</code></td><td>Up to 160 characters of utf8</td><td>Perl and Javascript Developer</td></tr> <tr><td><code>user.location</code></td><td>Up to 30 characters of utf8</td><td>Melbourne, Australia</td></tr> <tr><td><code>user.screen name</code></td><td>Up to 15 characters from: A-Z a-z 0-9 and _</td><td>RickMeasham</td></tr> <tr><td><code>user.url</code></td><td>Up to 100 characters of utf8</td><td> ![]() <tr><td><code>user.id</code></td><td>Integer</td><td>1050881</td></tr> </table> </html> (Note that the XML looks like: <code><statuses><status><created at> ... </created_at> ... </status><statuses></code> ![]() ===== Réponses utilisateurs = These responses are in reply to requests that return user information such as <code>friends</code> and <code>followers</code>. Fields returned: <html> <table style="width: 100%"> <tr><th>Field Path</th><th>Data format</th><th>Example</th></tr> <tr><td><code>id</code></td><td>Integer</td><td>1050881</td></tr> <tr><td><code>name</code></td><td>Up to 40 characters of utf8</td><td>Rick Measham</td></tr> <tr><td><code>location</code></td><td>Up to 30 characters of utf8</td><td>Melbourne, Australia</td></tr> <tr><td><code>description</code></td><td>Up to 160 characters of utf8</td><td>Perl and Javascript Developer</td></tr> <tr><td><code>profile image url</code></td><td>Valid URL at twitter.com (the query string appears to be a random number to force a reload each time)</td><td> ![]() <tr><td><code>url</code></td><td>Up to 100 characters of utf8</td><td> ![]() <tr><td><code>status.created at</code></td><td>HTTP Format date</td><td>Tue Mar 13 00:12:41 +0000 2007</td></tr> <tr><td><code>status.id</code></td><td>Integer</td><td>123</td></tr> <tr><td><code>status.text</code></td><td>Up to 160 characters of utf8</td><td>Creating this table</td></tr> </table> </html> (Note that the XML looks like: <code><users><user><created at> ... </created_at> ... </user><users></code> ![]() === Titres requêtes = These headers are currently considered a de facto standard. So they may change. Don't blame me if you have to change your code later on, but on 2007-03-21, Alex Payne (from Twitter ![]() Please do start sending headers to us. It'll be most helpful for planning our capacity. Rick Measham (that's me!) then suggested the following headers, to which Alex replied: Those X headers are exactly along the lines of what I was thinking. Thanks for setting a sane de-facto standard! The following request header **should** be used when making the above calls: * <code>X-Twitter ![]() The following request headers **can** be used when making the above calls: * <code>X-Twitter ![]() * <code>X-Twitter ![]() The URL **must** point to an XML document something like the following: <blockquote><pre> <client> <name>GoogleGadget</name> <version>2.01</version> <author> <name>Rick Measham</name> <email>google@twitter.isite.net.au</email> <twitter>RickMeasham</twitter> </author> <url> ![]() <twitter>GoogleGadget</twitter> <description><[CDATA[ The Twitter ![]() <a href=" ![]() ![]() ]]> </client> </pre></blockquote> **NOTE:** I expect this XML may change .. this was a quick hack. Join the developers list and chime in if you want to comment. === Conventions Les termes suivants sont utilisés dans ce document pour signifier les exigences de l'API. Ceux en gras ne s'appliquent uniquement que quand ils sont affichés en gras. (Ils sont basés sur la section 1.2 de la [1]) # **must**, or the adjective REQUIRED, means that the definition is an absolute requirement of the specification. # **must not** that the definition is an absolute prohibition of the specification. # **should** means that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications **must** be understood and carefully weighed before choosing a different course. # **should not* means that there may exist valid reasons in particular circumstances when the particular behavior is acceptable or even useful, but the full implications **should** be understood and the case carefully weighed before implementing any behavior described with this label. # **may**, or the adjective **optional**, means that an item is truly optional. One vendor may choose to include the item because a particular marketplace requires it or because the vendor feels that it enhances the product while another vendor may omit the same item. An implementation which does not include a particular option **must** be prepared to interoperate with another implementation which does include the option. * "Can" is used instead of "may" when referring to a possible circumstance or situation, as opposed to an optional facility. * "User" is used to refer to a human user, whereas "client" refers to the software being run by the user. ![]() * "twitter.com" means the server(s) against which the API works |
Toute autre implémentation d'autorisation basique devrait référer aux librairies WWW de votre langage de programmation.
Si vous préférez, vous pouvez utiliser un gestionnaire de cookie pour connecter via l'autorisation du site web. Envoyez une requête POST à http://twitter.com/login avec les ensembles de paramètres appropriés '<code>nomutilisateur ou email</code>' et '<code>motdepasse</code>'. Les titres de la réponse comprendront un cookie '<code>_twitter_session</code>' cookie. Présentez cela sur toutes les futures requêtes.
This command allows you to set various account settings for the authorized user. Send a POST to the following URL:
The following parameter names should be self explanatory. Don't forget to URL Encode both the parameter name and value if your library doesn't handle that for you automatically.
Champs renvoyés :
Field Path | Data format | Example |
---|---|---|
created_at | HTTP Format date | Tue Mar 13 00:12:41 +0000 2007 |
text | Up to 160 characters of utf8 | Creating this table |
id | Integer | 123 |
user.name | Up to 40 characters of utf8 | Rick Measham |
user.description | Up to 160 characters of utf8 | Perl and Javascript Developer |
user.location | Up to 30 characters of utf8 | Melbourne, Australia |
user.screen_name | Up to 15 characters from: A-Z a-z 0-9 and _ | RickMeasham |
user.url | Up to 100 characters of utf8 | http://rick.measham.id.au/ |
user.id | Integer | 1050881 |
Fields returned:
Field Path | Data format | Example |
---|---|---|
id | Integer | 1050881 |
name | Up to 40 characters of utf8 | Rick Measham |
location | Up to 30 characters of utf8 | Melbourne, Australia |
description | Up to 160 characters of utf8 | Perl and Javascript Developer |
profile_image_url | Valid URL at twitter.com (the query string appears to be a random number to force a reload each time) | http://static.twitter.com//system/user/profile_image/1050881/normal/rickm.png?1173740203 |
url | Up to 100 characters of utf8 | http://rick.measham.id.au/ |
status.created_at | HTTP Format date | Tue Mar 13 00:12:41 +0000 2007 |
status.id | Integer | 123 |
status.text | Up to 160 characters of utf8 | Creating this table |
(Note that the XML looks like: <code><users><user><created at> ... </created_at> ... </user><users></code>
Rick Measham (that's me!) then suggested the following headers, to which Alex replied: Those X headers are exactly along the lines of what I was thinking. Thanks for setting a sane de-facto standard!
The following request header **should** be used when making the above calls:
<client> <name>GoogleGadget</name> <version>2.01</version> <author> <name>Rick Measham</name> <email>google@twitter.isite.net.au</email> <twitter>RickMeasham</twitter> </author> <url>http://twitter.isite.net.au</url> <twitter>GoogleGadget</twitter> <description><[CDATA[ The Twitter Google Gadget brings all the fun of twitter to your Google personalised homepage. <a href="http://fusion.google.com/add?feedurl=http%3A//twitter.isite.net.au/twitter.xml"><img src="http://buttons.googlesyndication.com/fusion/add.gif" width="104" height="17" border="0" alt="Add to Google"></a> ]]> </client></blockquote>
![]() |
|
Les pages d'intérêt public
Accueil
A propos de Twitter ?
Célébrités Mineures
Chats
Commentaires des Clients
Evénements
FAQ
Les Fans
Les Faux
Pas des humains
Optimisons Twitter
Podcasteurs
Pourquoi ce site ?
Presse et média
Services
Twitter en bref
Brainstorming
Utilité de Twitter ?
Le coin des geeks
Docs API non officiels
script temps relatif
Design
animation: xtof
gabarit laurent
hébergement helmut sur son moulin ProWiki