Skip to content
Browse files

Issue #565: First iteration of the Post API

* Documented the tu_posts table fields
* Created Post API documentation
Closes #565
  • Loading branch information...
1 parent af2f2d0 commit 61008ceb5f38ac5a71aa9d8a0f56484125982b19 @samwho samwho committed with ginatrapani
Showing with 7,113 additions and 170 deletions.
  1. +16 −0 docs/source/userguide/api/errors/apicalltypenotrecognised.rst
  2. +11 −0 docs/source/userguide/api/errors/index.rst
  3. +17 −0 docs/source/userguide/api/errors/requiredargumentmissing.rst
  4. +16 −0 docs/source/userguide/api/errors/usernotfound.rst
  5. +9 −0 docs/source/userguide/api/index.rst
  6. +60 −0 docs/source/userguide/api/posts/index.rst
  7. +103 −0 docs/source/userguide/api/posts/post.rst
  8. +222 −0 docs/source/userguide/api/posts/post_replies.rst
  9. +181 −0 docs/source/userguide/api/posts/post_retweets.rst
  10. +197 −0 docs/source/userguide/api/posts/related_posts.rst
  11. +310 −0 docs/source/userguide/api/posts/user_mentions.rst
  12. +351 −0 docs/source/userguide/api/posts/user_posts.rst
  13. +745 −0 docs/source/userguide/api/posts/user_posts_in_range.rst
  14. +350 −0 docs/source/userguide/api/posts/user_questions.rst
  15. +306 −0 docs/source/userguide/api/posts/user_replies.rst
  16. +3 −2 docs/source/userguide/index.rst
  17. +94 −0 tests/TestOfPost.php
  18. +2,093 −0 tests/TestOfPostAPIController.php
  19. +428 −4 tests/TestOfPostMySQLDAO.php
  20. +2 −0 tests/TestOfTestController.php
  21. +76 −0 tests/TestOfUtils.php
  22. +3 −3 tests/WebTestOfUpgradeDatabase.php
  23. +2 −1 tests/all_controller_tests.php
  24. +2 −2 tests/classes/class.TestController.php
  25. +815 −0 webapp/_lib/controller/class.PostAPIController.php
  26. +61 −21 webapp/_lib/controller/class.ThinkUpController.php
  27. +34 −0 webapp/_lib/model/class.Post.php
  28. +232 −89 webapp/_lib/model/class.PostMySQLDAO.php
  29. +71 −0 webapp/_lib/model/class.Utils.php
  30. +33 −0 webapp/_lib/model/exceptions/class.APICallTypeNotRecognizedException.php
  31. +29 −0 webapp/_lib/model/exceptions/class.RequiredArgumentMissingException.php
  32. +33 −0 webapp/_lib/model/exceptions/class.UserNotFoundException.php
  33. +96 −21 webapp/_lib/model/interface.PostDAO.php
  34. +1 −0 webapp/_lib/view/json.tpl
  35. +32 −0 webapp/api/v1/post.php
  36. +27 −27 webapp/install/sql/build-db_mysql.sql
  37. +52 −0 webapp/install/sql/mysql_migrations/2011-03-27_post_comments.sql
View
16 docs/source/userguide/api/errors/apicalltypenotrecognised.rst
@@ -0,0 +1,16 @@
+APICallTpyeNotRecognisedException
+=================================
+This exception is thrown when you make an API call with a type that is not recognised.
+
+=======
+Example
+=======
+
+``api/v1/post.php?type=not_a_recognised_type&post_id=18152896965124096``::
+
+ {
+ "error":{
+ "type":"APICallTypeNotRecognised",
+ "message":"Your API call type not_a_recognised_type was not recognised."
+ }
+ }
View
11 docs/source/userguide/api/errors/index.rst
@@ -0,0 +1,11 @@
+API Errors
+==========
+
+Contents:
+
+.. toctree::
+ :maxdepth: 2
+
+ apicalltypenotrecognised
+ requiredargumentmissing
+ usernotfound
View
17 docs/source/userguide/api/errors/requiredargumentmissing.rst
@@ -0,0 +1,17 @@
+RequiredArgumentMissingException
+================================
+This exception is thrown when a required argument is missing from your API call. Required arguments are listed with
+each API type in the `ThinkUp Post API wiki <The ThinkUp Post API>`_.
+
+=======
+Example
+=======
+
+``api/v1/post.php?type=user_posts``::
+
+ {
+ "error":{
+ "type":"RequiredArgumentMissingException",
+ "message":"A request of type user_posts requires a user_id or username to be specified."
+ }
+ }
View
16 docs/source/userguide/api/errors/usernotfound.rst
@@ -0,0 +1,16 @@
+UserNotFoundException
+=====================
+This exception is thrown when you have queried for a user that does not exist in ThinkUp's database.
+
+=======
+Example
+=======
+
+``api/v1/post.php?type=user_posts&username=samwhat``::
+
+ {
+ "error":{
+ "type":"UserNotFoundException",
+ "message":"The user that you specified could not be found in our database."
+ }
+ }
View
9 docs/source/userguide/api/index.rst
@@ -0,0 +1,9 @@
+The ThinkUp API
+===============
+
+Contents:
+
+.. toctree::
+ :maxdepth: 3
+
+ posts/index
View
60 docs/source/userguide/api/posts/index.rst
@@ -0,0 +1,60 @@
+Post API
+========
+
+How does it work?
+-----------------
+
+The file to query for API results is located in <thinkup>/api/v1/post.php. There are a number of API call
+"types" and these can be specified in the "type" GET variable. Different API call types have their own set of required
+and optional parameters. Some of these are mapped to work in exactly the same way as the Twitter API but some are
+ThinkUp-specific.
+
+The output from the API is going has been modelled to look as much like the
+`Twitter Mentions API <http://dev.twitter.com/doc/get/statuses/mentions>`_ as possible. Any ThinkUp specific data can
+be found in a "thinkup" variable in each post and user when the output has been JSON decoded.
+
+**Important:** The ThinkUp API currently does not support any authentication methods. Because of this, you will not be
+able to retrieve protected posts with the API. The API will only return posts that are public on Twitter
+or published on a Facebook Page. (ThinkUp automatically marksl all Facebook user profile posts private.)
+
+How do I use it?
+----------------
+
+Using the API is quite simple. Let's say you wanted to make an API call of type "user_posts" for the user "samwhoo", your
+request would look like this:
+
+`http://example.com/your_thinkup_install/api/v1/post.php?type=user_posts&username=samwhoo`
+
+That call will output the latest 20 posts made by samwhoo (as the default number of posts to return is 20).
+
+Consistency
+-----------
+
+Unlike the Twitter API, the ThinkUp API tries its best to return to you the same format of data for every call to the
+API. The format that posts (tweets) are returned in remains consistent regardless of what API call you are making.
+
+This `Anatomy of a Tweet <http://www.scribd.com/doc/30146338/map-of-a-tweet>`_ PDF was one of our reference documents.
+It's a very good start for anyone wishing to learn the Twitter or ThinkUp API.
+
+Facebook Support
+----------------
+
+As of this moment, you **can** use the API to search for Facebook posts but it is untested and experimental. The aim of
+this first iteration of the API was to nail Twitter support.
+
+Post API Call Reference
+-----------------------
+
+.. toctree::
+ :maxdepth: 1
+
+ post
+ post_replies
+ post_retweets
+ related_posts
+ user_mentions
+ user_posts
+ user_posts_in_range
+ user_questions
+ user_replies
+ ../errors/index
View
103 docs/source/userguide/api/posts/post.rst
@@ -0,0 +1,103 @@
+Post
+=====
+Gets a single post.
+
+**API type slug:** ``post``
+
+**Example usage:** ``api/v1/post.php?type=post&post_id=12345``
+
+==================
+Required arguments
+==================
+
+* **post_id**
+
+ The ID of the post to retrieve.
+
+==================
+Optional Arguments
+==================
+
+* **network**
+
+ The network to use in the call. Defaults to 'twitter'.
+
+* **include_entities**
+
+ Whether or not to include `Tweet Entities <http://dev.twitter.com/pages/tweet_entities>`_ in the output.
+ Defaults to false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+* **include_replies**
+
+ Whether or not to include replies to this post in the output. This argument is recursive and will retrieve replies
+ to replies also. Defaults to false. This argument can be set to true by making it equal to either **1**, **t** or
+ **true**.
+
+* **trim_user**
+
+ If set to true, this flag strips the user part of the output to just the user's ID and nothing else. Defaults to
+ false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+==============
+Example output
+==============
+
+``api/v1/post.php?post_id=18152896965124096`` (the API type defaults to ``post``)::
+
+ {
+ "id":18152896965124096,
+ "source":"web",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":20636385,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":17764087211491328,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":324,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@Stellar190 Application in astronomy, you say? Do you have any examples? :) (I don't doubt it, I'm just curious)",
+ "created_at":"Fri Dec 24 03:56:02 +0000 2010",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":2,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":775,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ }
View
222 docs/source/userguide/api/posts/post_replies.rst
@@ -0,0 +1,222 @@
+Post Replies
+============
+Gets the replies to a post.
+
+**API call type slug:** ``post_replies``
+
+**Example Usage:** ``api/v1/post.php?type=post_replies&post_id=12345``
+
+==================
+Required arguments
+==================
+
+* **post_id**
+
+ The ID of the post to retrieve replies to.
+
+==================
+Optional Arguments
+==================
+
+* **network**
+
+ The network to use in the call. Defaults to 'twitter'.
+
+* **order_by**
+
+ The column to order the results by. Defaults to chronological order ("date"). The default direction to order
+ results from this call are descending.
+
+* **unit**
+
+ Sets the unit of measurement to return the ``reply_retweet_distance`` in. Can be either "mi" for miles or "km"
+ for kilometres. Defaults to "km".
+
+* **count**
+
+ The number of results to display from this API call. Defaults to 20.
+
+* **page**
+
+ The page of results to display for this API call. Defaults to 1.
+
+* **include_entities**
+
+ Whether or not to include `Tweet Entities <http://dev.twitter.com/pages/tweet_entities>`_ in the output. Defaults
+ to false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+* **include_replies**
+
+ Whether or not to include replies to this post in the output. This argument is recursive and will retrieve replies
+ to replies also. Defaults to false. This argument can be set to true by making it equal to either **1**, **t** or
+ **true**.
+
+* **trim_user**
+
+ If set to true, this flag strips the user part of the output to just the user's ID and nothing else. Defaults to
+ false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+==============
+Example output
+==============
+
+
+``api/v1/post.php?type=post_replies&post_id=52490798066958336&include_entities=true``::
+
+
+ [
+ {
+ "id":52495440951771136,
+ "source":"<a href=\"http://mobile.twitter.com\" rel=\"nofollow\">Twitter for Android</a>",
+ "location":"Seattle, WA, USA",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 47.6062095,
+ -122.3320708
+ ]
+ },
+ "in_reply_to_user_id":69410725,
+ "is_reply_by_friend":true,
+ "in_reply_to_post_id":52490798066958336,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":7457,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "short_location":"Seattle, WA, USA",
+ "text":"@samwhoo Webfinger: http://t.co/zmlLgeG",
+ "created_at":"Mon Mar 28 22:21:03 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 47.6062095,
+ -122.3320708
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":1,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":13205432,
+ "location":"Seattle, WA, USA",
+ "description":"Beloved by cats",
+ "url":"http://trevorbramble.com/",
+ "friend_count":198,
+ "followers_count":261,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1256194278/Untitled_normal.png",
+ "name":"Trevor Bramble",
+ "screen_name":"TrevorBramble",
+ "statuses_count":5209,
+ "created_at":"Thu Feb 07 14:32:32 +0000 2008",
+ "favourites_count":8,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"2011-03-30 15:44:29",
+ "last_post_id":54009144910430208,
+ "found_in":"Friends"
+ }
+ },
+ "entities":{
+ "urls":[
+
+ ],
+ "hashtags":[
+
+ ],
+ "user_mentions":[
+ {
+ "name":"Sam Rose",
+ "id":69410725,
+ "screen_name":"samwhoo",
+ "indices":[
+ 0,
+ 8
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "id":52496414823038977,
+ "source":"<a href=\"http://www.tweetdeck.com\" rel=\"nofollow\">TweetDeck</a>",
+ "location":"Atlanta, GA, USA",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 33.7489954,
+ -84.3879824
+ ]
+ },
+ "in_reply_to_user_id":69410725,
+ "is_reply_by_friend":true,
+ "in_reply_to_post_id":52490798066958336,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":6496,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "short_location":"Atlanta, GA, USA",
+ "text":"@samwhoo on it right now",
+ "created_at":"Mon Mar 28 22:24:55 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 33.7489954,
+ -84.3879824
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":19941670,
+ "location":"Atlanta, Georgia",
+ "description":"Living Life the way it shouldn't be lived... did that make sense??? :) Writer, programmer, technology enthusiast by nature.",
+ "url":"http://intety.com",
+ "friend_count":75,
+ "followers_count":162,
+ "profile_image_url":"http://a0.twimg.com/profile_images/1287940880/eightbit-f848a5c3-d78a-4a54-9488-20eed7fd5990_normal.png",
+ "name":"randi miller",
+ "screen_name":"randi2kewl",
+ "statuses_count":2264,
+ "created_at":"Mon Feb 02 23:34:49 +0000 2009",
+ "favourites_count":1,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":54261744004108288,
+ "found_in":"retweets"
+ }
+ },
+ "entities":{
+ "urls":[
+
+ ],
+ "hashtags":[
+
+ ],
+ "user_mentions":[
+ {
+ "name":"Sam Rose",
+ "id":69410725,
+ "screen_name":"samwhoo",
+ "indices":[
+ 0,
+ 8
+ ]
+ }
+ ]
+ }
+ }
+ ]
View
181 docs/source/userguide/api/posts/post_retweets.rst
@@ -0,0 +1,181 @@
+Post Retweets
+=============
+Gets all retweets of a post.
+
+**API call type slug:** ``post_retweets``
+
+**Example Usage:** ``api/v1/post.php?type=post_retweets&post_id=12345``
+
+==================
+Required arguments
+==================
+
+* **post_id**
+
+ The ID of the post to retrieve retweets of.
+
+==================
+Optional Arguments
+==================
+
+* **network**
+
+ The network to use in the call. Defaults to 'twitter'.
+
+* **order_by**
+
+ The column to order the results by. Defaults to chronological order ("date"). The default direction to order
+ results from this call are descending.
+
+* **unit**
+
+ Sets the unit of measurement to return the ``reply_retweet_distance`` in. Can be either "mi" for miles or "km"
+ for kilometres. Defaults to "km".
+
+* **count**
+
+ The number of results to display from this API call. Defaults to 20.
+
+* **page**
+
+ The page of results to display for this API call. Defaults to 1.
+
+* **include_entities**
+
+ Whether or not to include `Tweet Entities <http://dev.twitter.com/pages/tweet_entities>`_ in the output. Defaults
+ to false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+* **include_replies**
+
+ Whether or not to include replies to this post in the output. This argument is recursive and will retrieve replies
+ to replies also. Defaults to false. This argument can be set to true by making it equal to either **1**, **t** or
+ **true**.
+
+* **trim_user**
+
+ If set to true, this flag strips the user part of the output to just the user's ID and nothing else. Defaults to
+ false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+==============
+Example output
+==============
+
+``api/v1/post.php?type=post_retweets&post_id=17393678888738816``::
+
+ [
+ {
+ "id":17438947407831040,
+ "source":"web",
+ "location":"Liverpool, Merseyside, UK",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 53.4107766,
+ -2.9778383
+ ]
+ },
+ "in_reply_to_user_id":null,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":69410725,
+ "reply_retweet_distance":119,
+ "is_retweet_by_friend":true,
+ "favorited":false,
+ "all_retweets":0,
+ "short_location":"Liverpool, Merseyside, UK",
+ "text":"RT @samwhoo: Comic Sans is trending? A bit late aren't you, Twitter?",
+ "created_at":"Wed Dec 22 04:39:03 +0000 2010",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 53.4107766,
+ -2.9778383
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":92529373,
+ "location":"Liverpool.",
+ "description":"Online and pissed off.",
+ "url":"",
+ "friend_count":38,
+ "followers_count":40,
+ "profile_image_url":"http://a0.twimg.com/profile_images/1249376120/Photo_1_normal.jpg",
+ "name":"David Parry",
+ "screen_name":"buildthewall",
+ "statuses_count":514,
+ "created_at":"Wed Nov 25 14:11:37 +0000 2009",
+ "favourites_count":0,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"2011-03-27 22:11:31",
+ "last_post_id":52130655026417664,
+ "found_in":"Friends"
+ }
+ },
+ "retweeted_status":{
+ "id":17393678888738816,
+ "source":"web",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":null,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":1,
+ "text":"Comic Sans is trending? A bit late aren't you, Twitter?",
+ "created_at":"Wed Dec 22 01:39:10 +0000 2010",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":1,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":775,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ }
+ }
+ ]
View
197 docs/source/userguide/api/posts/related_posts.rst
@@ -0,0 +1,197 @@
+Related Posts
+=============
+Gets posts that are related to a post. By this we mean replies and retweets.
+
+**API call type slug:** ``related_posts``
+
+**Example Usage:** ``api/v1/post.php?type=related_posts&post_id=12345``
+
+==================
+Required arguments
+==================
+
+* **post_id**
+
+ The ID of the post to find related posts for.
+
+==================
+Optional Arguments
+==================
+
+* **network**
+
+ The network to use in the call. Defaults to 'twitter'.
+
+* **count**
+
+ The number of results to display from this API call. Defaults to 20.
+
+* **page**
+
+ The page of results to display for this API call. Defaults to 1.
+
+* **include_entities**
+
+ Whether or not to include `Tweet Entities <http://dev.twitter.com/pages/tweet_entities>`_ in the output. Defaults
+ to false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+* **include_replies**
+
+ Whether or not to include replies to this post in the output. This argument is recursive and will retrieve replies
+ to replies also. Defaults to false. This argument can be set to true by making it equal to either **1**, **t** or
+ **true**.
+
+* **trim_user**
+
+ If set to true, this flag strips the user part of the output to just the user's ID and nothing else. Defaults to
+ false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+==============
+Example output
+==============
+
+``api/v1/post.php?type=related_posts&post_id=4329245409021953&include_entities=true``::
+
+ [
+ {
+ "id":5639421072244736,
+ "source":"web",
+ "location":"Milky Way Galaxy",
+ "place":null,
+ "geo":null,
+ "in_reply_to_user_id":69410725,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":4329245409021953,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@samwhoo Hey, only just saw your great blogpost! Thanks so much, and heck I'm useless at coming to talk to people so please do talk to me!",
+ "created_at":"Fri Nov 19 15:11:57 +0000 2010",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":2
+ },
+ "user":{
+ "id":20635230,
+ "location":"Milky Way Galaxy",
+ "description":"Moderator of Galaxy Zoo & co-founder of Skeptics in the Pub in Wales; citizen science & astronomy enthusiast; humanist & skeptic who writes too much",
+ "url":"http://www.aliceingalaxyland.blogspot.com",
+ "friend_count":473,
+ "followers_count":1377,
+ "profile_image_url":"http://a2.twimg.com/profile_images/1207391142/penguin_shrunk_SDSS_wise_normal.jpg",
+ "name":"Alice Sheppard",
+ "screen_name":"PenguinGalaxy",
+ "statuses_count":26562,
+ "created_at":"Wed Feb 11 22:27:37 +0000 2009",
+ "favourites_count":264,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"2011-04-03 01:34:06",
+ "last_post_id":53902343061778432,
+ "found_in":"retweets"
+ }
+ },
+ "entities":{
+ "urls":[
+
+ ],
+ "hashtags":[
+
+ ],
+ "user_mentions":[
+ {
+ "name":"Sam Rose",
+ "id":69410725,
+ "screen_name":"samwhoo",
+ "indices":[
+ 0,
+ 8
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "id":5658882579898369,
+ "source":"<a href=\"http://itunes.apple.com/app/twitter/id333903271?mt=8\" rel=\"nofollow\">Twitter for iPad</a>",
+ "location":"Cardiff, UK",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 51.4813069,
+ -3.1804979
+ ]
+ },
+ "in_reply_to_user_id":69410725,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":4329245409021953,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":119,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@samwhoo Very, very annoyed with my parents for not letting me go :(",
+ "created_at":"Fri Nov 19 16:29:17 +0000 2010",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 51.4813069,
+ -3.1804979
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":15040935,
+ "location":"Cardiff",
+ "description":"16 year old. I do a podcast, SDWFD(w/c!) http://v.gd/superwooduo. Skeptic.",
+ "url":"http://thewelshboyo.co.uk",
+ "friend_count":304,
+ "followers_count":1367,
+ "profile_image_url":"http://a3.twimg.com/profile_images/1295858459/4aed4901-d81b-490d-a35a-8babff8a4d48_normal.png",
+ "name":"Rhys Morgan",
+ "screen_name":"rhysmorgan",
+ "statuses_count":31551,
+ "created_at":"Sat Jun 07 19:42:58 +0100 2008",
+ "favourites_count":23,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"2011-04-03 00:16:41",
+ "last_post_id":53932036381089792,
+ "found_in":"retweets"
+ }
+ },
+ "entities":{
+ "urls":[
+
+ ],
+ "hashtags":[
+
+ ],
+ "user_mentions":[
+ {
+ "name":"Sam Rose",
+ "id":69410725,
+ "screen_name":"samwhoo",
+ "indices":[
+ 0,
+ 8
+ ]
+ }
+ ]
+ }
+ }
+ ]
View
310 docs/source/userguide/api/posts/user_mentions.rst
@@ -0,0 +1,310 @@
+User Mentions
+=============
+Gets posts that a user is mentioned in.
+
+**API call type slug:** ``user_mentions``
+
+**Example Usage:** ``api/v1/post.php?type=user_mentions&username=samwhoo``
+
+==================
+Required arguments
+==================
+
+* **user_id** or **username**
+
+ Only one of these is required. They are to specify the user to gather posts for in this call.
+
+==================
+Optional Arguments
+==================
+
+* **network**
+
+ The network to use in the call. Defaults to 'twitter'.
+
+* **order_by**
+
+ The column to order the results by. Defaults to chronological order ("date").
+
+* **direction**
+
+ The direction to order the results in. Can be either DESC or ASC. Defaults to DESC.
+
+* **include_rts**
+
+ Whether or not to include retweets as mentions. Defaults to false. This argument can be set to true by making it
+ equal to either **1**, **t** or **true**.
+
+* **count**
+
+ The number of results to display from this API call. Defaults to 20.
+
+* **page**
+
+ The page of results to display for this API call. Defaults to 1.
+
+* **include_entities**
+
+ Whether or not to include `Tweet Entities <http://dev.twitter.com/pages/tweet_entities>`_ in the output. Defaults
+ to false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+* **include_replies**
+
+ Whether or not to include replies to this post in the output. This argument is recursive and will retrieve replies
+ to replies also. Defaults to false. This argument can be set to true by making it equal to either **1**, **t** or
+ **true**.
+
+* **trim_user**
+
+ If set to true, this flag strips the user part of the output to just the user's ID and nothing else. Defaults to
+ false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+==============
+Example output
+==============
+
+``api/v1/post.php?type=user_mentions&username=samwhoo&count=5``::
+
+ [
+ {
+ "id":54361082340458498,
+ "source":"<a href=\"http://github.com/drdrang/drtwoot\" rel=\"nofollow\">Dr. Twoot</a>",
+ "location":"Naperville, Illinois",
+ "place":null,
+ "geo":null,
+ "in_reply_to_user_id":69410725,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":54355802038878208,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@samwhoo Well, the export button for search results doesn\u2019t seem to do anything. Am I missing something obvious?",
+ "created_at":"Sun Apr 03 01:54:26 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":0
+ },
+ "user":{
+ "id":10697232,
+ "location":"Naperville, Illinois",
+ "description":"Retired snowman from Santa's Village.",
+ "url":"http://www.leancrew.com/all-this",
+ "friend_count":79,
+ "followers_count":373,
+ "profile_image_url":"http://a3.twimg.com/profile_images/74036670/snowman2_normal.jpg",
+ "name":"Dr. Drang",
+ "screen_name":"drdrang",
+ "statuses_count":4337,
+ "created_at":"Thu Nov 29 03:56:42 +0000 2007",
+ "favourites_count":134,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"mentions"
+ }
+ }
+ },
+ {
+ "id":54351904683200513,
+ "source":"web",
+ "location":"Milky Way Galaxy",
+ "place":null,
+ "geo":null,
+ "in_reply_to_user_id":69410725,
+ "is_reply_by_friend":true,
+ "in_reply_to_post_id":54351245707722752,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@samwhoo Degrees from the University of Open Sauce are more common I'm afraid . . .",
+ "created_at":"Sun Apr 03 01:17:58 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":2
+ },
+ "user":{
+ "id":20635230,
+ "location":"Milky Way Galaxy",
+ "description":"Moderator of Galaxy Zoo & co-founder of Skeptics in the Pub in Wales; citizen science & astronomy enthusiast; humanist & skeptic who writes too much",
+ "url":"http://www.aliceingalaxyland.blogspot.com",
+ "friend_count":473,
+ "followers_count":1377,
+ "profile_image_url":"http://a2.twimg.com/profile_images/1207391142/penguin_shrunk_SDSS_wise_normal.jpg",
+ "name":"Alice Sheppard",
+ "screen_name":"PenguinGalaxy",
+ "statuses_count":26562,
+ "created_at":"Wed Feb 11 22:27:37 +0000 2009",
+ "favourites_count":264,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"2011-04-03 01:34:06",
+ "last_post_id":53902343061778432,
+ "found_in":"retweets"
+ }
+ }
+ },
+ {
+ "id":54319541915881472,
+ "source":"web",
+ "location":"Wales",
+ "place":null,
+ "geo":null,
+ "in_reply_to_user_id":69410725,
+ "is_reply_by_friend":true,
+ "in_reply_to_post_id":54212753145069568,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@samwhoo Your broke think up with 11 characters. that's impressive",
+ "created_at":"Sat Apr 02 23:09:22 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":0
+ },
+ "user":{
+ "id":221187763,
+ "location":"Wales",
+ "description":"Second year computer forensics student, promoter for flirt and all round drunk guy. ",
+ "url":"",
+ "friend_count":36,
+ "followers_count":9,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1178797185/60388_10150291371470193_585435192_15028818_5822008_n_normal.jpg",
+ "name":"Carl Lewis",
+ "screen_name":"Carlos13th",
+ "statuses_count":19,
+ "created_at":"Tue Nov 30 00:02:26 +0000 2010",
+ "favourites_count":0,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"2011-03-10 02:04:41",
+ "last_post_id":53460536481955840,
+ "found_in":"mentions"
+ }
+ }
+ },
+ {
+ "id":54200520822374400,
+ "source":"<a href=\"http://itunes.apple.com/app/twitter/id333903271?mt=8\" rel=\"nofollow\">Twitter for iPad</a>",
+ "location":"Cardiff",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 51.4813069,
+ -3.1804979
+ ]
+ },
+ "in_reply_to_user_id":69410725,
+ "is_reply_by_friend":true,
+ "in_reply_to_post_id":54199405577904128,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":119,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@samwhoo That much is true.",
+ "created_at":"Sat Apr 02 15:16:25 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 51.4813069,
+ -3.1804979
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":15040935,
+ "location":"Cardiff",
+ "description":"16 year old. I do a podcast, SDWFD(w/c!) http://v.gd/superwooduo. Skeptic.",
+ "url":"http://thewelshboyo.co.uk",
+ "friend_count":304,
+ "followers_count":1367,
+ "profile_image_url":"http://a3.twimg.com/profile_images/1295858459/4aed4901-d81b-490d-a35a-8babff8a4d48_normal.png",
+ "name":"Rhys Morgan",
+ "screen_name":"rhysmorgan",
+ "statuses_count":31551,
+ "created_at":"Sat Jun 07 19:42:58 +0100 2008",
+ "favourites_count":23,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"2011-04-03 00:16:41",
+ "last_post_id":53932036381089792,
+ "found_in":"retweets"
+ }
+ }
+ },
+ {
+ "id":54189744225124352,
+ "source":"web",
+ "location":"Wales",
+ "place":null,
+ "geo":null,
+ "in_reply_to_user_id":69410725,
+ "is_reply_by_friend":true,
+ "in_reply_to_post_id":54001484991430656,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@samwhoo what happened?",
+ "created_at":"Sat Apr 02 14:33:36 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":1,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":0
+ },
+ "user":{
+ "id":221187763,
+ "location":"Wales",
+ "description":"Second year computer forensics student, promoter for flirt and all round drunk guy. ",
+ "url":"",
+ "friend_count":36,
+ "followers_count":9,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1178797185/60388_10150291371470193_585435192_15028818_5822008_n_normal.jpg",
+ "name":"Carl Lewis",
+ "screen_name":"Carlos13th",
+ "statuses_count":19,
+ "created_at":"Tue Nov 30 00:02:26 +0000 2010",
+ "favourites_count":0,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"2011-03-10 02:04:41",
+ "last_post_id":53460536481955840,
+ "found_in":"mentions"
+ }
+ }
+ }
+ ]
View
351 docs/source/userguide/api/posts/user_posts.rst
@@ -0,0 +1,351 @@
+User Posts
+==========
+Gets a user's posts.
+
+**API call type slug:** ``user_posts``
+
+**Example Usage:** ``api/v1/post.php?type=user_posts&username=samwhoo``
+
+==================
+Required arguments
+==================
+
+* **user_id** or **username**
+
+ Only one of these is required. They are to specify the user to gather posts for in this call.
+
+==================
+Optional Arguments
+==================
+
+* **network**
+
+ The network to use in the call. Defaults to 'twitter'.
+
+* **order_by**
+
+ The column to order the results by. Defaults to chronological order ("date").
+
+* **direction**
+
+ The direction to order the results in. Can be either DESC or ASC. Defaults to DESC.
+
+* **count**
+
+ The number of results to display from this API call. Defaults to 20.
+
+* **page**
+
+ The page of results to display for this API call. Defaults to 1.
+
+* **include_entities**
+
+ Whether or not to include `Tweet Entities <http://dev.twitter.com/pages/tweet_entities>`_ in the output. Defaults
+ to false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+* **include_replies**
+
+ Whether or not to include replies to this post in the output. This argument is recursive and will retrieve replies
+ to replies also. Defaults to false. This argument can be set to true by making it equal to either **1**, **t** or
+ **true**.
+
+* **trim_user**
+
+ If set to true, this flag strips the user part of the output to just the user's ID and nothing else. Defaults to
+ false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+==============
+Example output
+==============
+
+
+``api/v1/post.php?type=user_posts&username=samwhoo&count=5&order_by=date&direction=ASC``
+(this is getting the first 5 posts I ever made on Twitter! :))::
+
+ [
+ {
+ "id":3995929168,
+ "source":"web",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":null,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"so, uhm... where am I again?",
+ "created_at":"Tue Sep 15 02:42:48 +0100 2009",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":779,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ },
+ {
+ "id":4013777537,
+ "source":"web",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":null,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"finally got Python scripts to execute from Notepad++!",
+ "created_at":"Tue Sep 15 21:20:32 +0100 2009",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":779,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ },
+ {
+ "id":5507807393,
+ "source":"<a href=\"http://arsecandle.org/twadget/\" rel=\"nofollow\">Twadget</a>",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":null,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"TWIg ftw!",
+ "created_at":"Sat Nov 07 15:16:07 +0000 2009",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":779,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ },
+ {
+ "id":5515432396,
+ "source":"<a href=\"http://dev.twitter.com/\" rel=\"nofollow\">API</a>",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":null,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"FINALLY got the AJAX script retrieving data and displaying it properly from the database. Query writing time!",
+ "created_at":"Sat Nov 07 21:26:04 +0000 2009",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":779,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ },
+ {
+ "id":5689411141,
+ "source":"web",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":null,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"Thanks to @Ben909 I should have a Google Wave account soon :) Thanks man!",
+ "created_at":"Fri Nov 13 20:08:19 +0000 2009",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":779,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ }
+ ]
View
745 docs/source/userguide/api/posts/user_posts_in_range.rst
@@ -0,0 +1,745 @@
+User Posts In Range
+===================
+Gets a user's posts in a given time range.
+
+**API call type slug:** ``user_posts_in_range``
+
+**Example Usage:** ``api/v1/post.php?type=user_posts_in_range&from=29-03-2011&until=04-04-2011&username=samwhoo``
+
+==================
+Required arguments
+==================
+
+* **user_id** or **username**
+
+ Only one of these is required. They are to specify the user to gather posts for in this call.
+
+* **from**
+
+ The date/time to start searching from. This can either be a
+ `valid date string <http://www.php.net/manual/en/datetime.formats.php>`_ or a Unix timestamp.
+
+* **until**
+
+ The date/time to search until. This can either be a
+ `valid date string <http://www.php.net/manual/en/datetime.formats.php>`_ or a Unix timestamp.
+
+==================
+Optional Arguments
+==================
+
+* **network**
+
+ The network to use in the call. Defaults to 'twitter'.
+
+* **order_by**
+
+ The column to order the results by. Defaults to chronological order ("date").
+
+* **direction**
+
+ The direction to order the results in. Can be either DESC or ASC. Defaults to DESC.
+
+* **include_entities**
+
+ Whether or not to include `Tweet Entities <http://dev.twitter.com/pages/tweet_entities>`_ in the output. Defaults
+ to false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+* **include_replies**
+
+ Whether or not to include replies to this post in the output. This argument is recursive and will retrieve replies
+ to replies also. Defaults to false. This argument can be set to true by making it equal to either **1**, **t** or
+ **true**.
+
+* **trim_user**
+
+ If set to true, this flag strips the user part of the output to just the user's ID and nothing else. Defaults to
+ false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+==============
+Example output
+==============
+
+``api/v1/post.php?type=user_posts_in_range&from=02-04-2011&until=04-04-2011&username=samwhoo``::
+
+
+ [
+ {
+ "id":54365021995663360,
+ "source":"web",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":10697232,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":54361082340458498,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":6117,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@drdrang Hm. Doesn't seem to be doing anything for me either. Wanna post this to the mailing list and help us improve the app? :)",
+ "created_at":"Sun Apr 03 02:10:05 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":1,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":780,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ },
+ {
+ "id":54356409298587648,
+ "source":"web",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":930061,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@ginatrapani \"NEXT MILESTONE: 917 days till you reach 1,000 followers at this rate.\" - Perhaps make this metric a little less ambitious? :p",
+ "created_at":"Sun Apr 03 01:35:52 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":780,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ },
+ {
+ "id":54355802038878208,
+ "source":"web",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":10697232,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":54316403053969408,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":6117,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@drdrang @matthewmcvickar How are you guys finding ThinkUp? Any suggestions for features or fixes? :)",
+ "created_at":"Sun Apr 03 01:33:27 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":1,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":780,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ },
+ {
+ "id":54355320696356864,
+ "source":"web",
+ "location":"Wales, UK",
+ "place":null,
+ "geo":null,
+ "in_reply_to_user_id":20635230,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":54351904683200513,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@PenguinGalaxy Haha! Mm, lots of kids just do a degree in easy so they can hide from the world for another 3 years. Sucks hard :(",
+ "created_at":"Sun Apr 03 01:31:32 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":0
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":780,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ },
+ {
+ "id":54351245707722752,
+ "source":"web",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":null,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":1,
+ "text":"When I finish my education, I want a first class honours degree from the University of Open Source.",
+ "created_at":"Sun Apr 03 01:15:21 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":1,
+ "reply_count_cache":1,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":780,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ },
+ {
+ "id":54346303643189248,
+ "source":"web",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":null,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":838211,
+ "reply_retweet_distance":5760,
+ "is_retweet_by_friend":true,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"RT @digitalvision: \"Oh my God, Becky. Look at that pizza. It's so.. Big. So round. Like one of those rap guy's pizzas or something.\"",
+ "created_at":"Sun Apr 03 00:55:43 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":780,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ },
+ "retweeted_status":{
+ "id":54345143683264513,
+ "source":"<a href=\"http://twitter.com/\" rel=\"nofollow\">Twitter for iPhone</a>",
+ "location":"Detroit, MI, USA",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 42.331427,
+ -83.0457538
+ ]
+ },
+ "in_reply_to_user_id":null,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":1,
+ "text":"\"Oh my God, Becky. Look at that pizza. It's so.. Big. So round. Like one of those rap guy's pizzas or something.\"",
+ "created_at":"Sun Apr 03 00:51:06 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 42.331427,
+ -83.0457538
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":1,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":838211,
+ "location":"Detroit, MI",
+ "description":"1/2 cup Urbanist, 3/4 cup Digital Marketing Pro, 1/2 cup Geek Culture, dash of baseball fan with a tablespoon of awesome. First Detroit #techkaraoke champ.",
+ "url":"http://www.portagemedia.com",
+ "friend_count":2001,
+ "followers_count":2194,
+ "profile_image_url":"http://a2.twimg.com/profile_images/1297333462/twitter-export_normal.jpg",
+ "name":"Jeremiah Staes",
+ "screen_name":"digitalvision",
+ "statuses_count":15570,
+ "created_at":"Fri Mar 09 17:13:01 +0000 2007",
+ "favourites_count":103,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"2011-03-30 18:00:01",
+ "last_post_id":54240564530528257,
+ "found_in":"Friends"
+ }
+ }
+ }
+ },
+ {
+ "id":54212753145069568,
+ "source":"web",
+ "location":"Wales, UK",
+ "place":null,
+ "geo":null,
+ "in_reply_to_user_id":221187763,
+ "is_reply_by_friend":true,
+ "in_reply_to_post_id":54189744225124352,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@Carlos13th I broke ThinkUp's ability to store posts in its database :p I only did it locally, but it only took 11 misplaced characters :p",
+ "created_at":"Sat Apr 02 16:05:02 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":1,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":0
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":780,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ },
+ {
+ "id":54199405577904128,
+ "source":"web",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":15040935,
+ "is_reply_by_friend":true,
+ "in_reply_to_post_id":54193366124085249,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":119,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@rhysmorgan The scout is amazing if you're quick on the headshots :) Makes you look pro, too.",
+ "created_at":"Sat Apr 02 15:11:59 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":1,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":780,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ },
+ {
+ "id":54173992705204224,
+ "source":"web",
+ "location":"Wales, UK",
+ "place":null,
+ "geo":null,
+ "in_reply_to_user_id":null,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":19544379,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"RT @_L_M_C_: If this audiobook doesn't download properly I'll never hear the end of it.",
+ "created_at":"Sat Apr 02 13:31:01 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":0
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":780,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ },
+ "retweeted_status":{
+ "id":54168009958367232,
+ "source":"web",
+ "location":null,
+ "place":null,
+ "geo":null,
+ "in_reply_to_user_id":null,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":8,
+ "text":"If this audiobook doesn't download properly I'll never hear the end of it.",
+ "created_at":"Sat Apr 02 13:07:14 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "thinkup":{
+ "retweet_count_cache":8,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":0
+ },
+ "user":null
+ }
+ },
+ {
+ "id":54025293215711232,
+ "source":"web",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":32372003,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":54023437231980544,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":5415,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@MaizieFellows @ben_hay I wouldn't worry, Maizie, I wasn't included either :&lt;",
+ "created_at":"Sat Apr 02 03:40:08 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":1,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":780,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ },
+ {
+ "id":54001484991430656,
+ "source":"web",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":null,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"Wow. It's remarkable how much damage 11 characters can do when they're put somewhere they don't belong. #wondersofcode",
+ "created_at":"Sat Apr 02 02:05:31 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":1,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":780,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ }
+ ]
View
350 docs/source/userguide/api/posts/user_questions.rst
@@ -0,0 +1,350 @@
+User Questions
+==============
+Gets question posts by a user. This will return all of the posts a user has made that contain questions.
+
+**API call type slug:** ``user_questions``
+
+**Example Usage:** ``api/v1/post.php?type=user_questions&username=samwhoo``
+
+==================
+Required arguments
+==================
+
+* **user_id** or **username**
+
+ Only one of these is required. They are to specify the user to gather posts for in this call.
+
+==================
+Optional Arguments
+==================
+
+* **network**
+
+ The network to use in the call. Defaults to 'twitter'.
+
+* **order_by**
+
+ The column to order the results by. Defaults to chronological order ("date").
+
+* **direction**
+
+ The direction to order the results in. Can be either DESC or ASC. Defaults to DESC.
+
+* **count**
+
+ The number of results to display from this API call. Defaults to 20.
+
+* **page**
+
+ The page of results to display for this API call. Defaults to 1.
+
+* **include_entities**
+
+ Whether or not to include `Tweet Entities <http://dev.twitter.com/pages/tweet_entities>`_ in the output. Defaults
+ to false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+* **include_replies**
+
+ Whether or not to include replies to this post in the output. This argument is recursive and will retrieve replies
+ to replies also. Defaults to false. This argument can be set to true by making it equal to either **1**, **t** or
+ **true**.
+
+* **trim_user**
+
+ If set to true, this flag strips the user part of the output to just the user's ID and nothing else. Defaults to
+ false. This argument can be set to true by making it equal to either **1**, **t** or **true**.
+
+==============
+Example output
+==============
+
+``api/v1/post.php?type=user_questions&username=samwhoo&count=5``::
+
+
+ [
+ {
+ "id":54356409298587648,
+ "source":"web",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":930061,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@ginatrapani \"NEXT MILESTONE: 917 days till you reach 1,000 followers at this rate.\" - Perhaps make this metric a little less ambitious? :p",
+ "created_at":"Sun Apr 03 01:35:52 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "thinkup":{
+ "retweet_count_cache":0,
+ "reply_count_cache":0,
+ "old_retweet_count_cache":0,
+ "is_geo_encoded":1
+ },
+ "user":{
+ "id":69410725,
+ "location":"Wales, UK",
+ "description":"20 years old. Born and raised in Wales, UK. Programmer, British Mensa member, grapefruit, terrible at writing tag lines.",
+ "url":"http://lbak.co.uk",
+ "friend_count":225,
+ "followers_count":83,
+ "profile_image_url":"http://a1.twimg.com/profile_images/1140823002/28567_10150158194220371_544780370_11863380_6914499_n_normal.jpg",
+ "name":"Sam Rose",
+ "screen_name":"samwhoo",
+ "statuses_count":780,
+ "created_at":"Thu Aug 27 21:32:42 +0100 2009",
+ "favourites_count":36,
+ "utc_offset":3600,
+ "thinkup":{
+ "last_post":"0000-00-00 00:00:00",
+ "last_post_id":0,
+ "found_in":"Owner Status"
+ }
+ }
+ },
+ {
+ "id":53476079138123776,
+ "source":"web",
+ "location":"Wales, United Kingdom",
+ "place":null,
+ "geo":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },
+ "in_reply_to_user_id":126162586,
+ "is_reply_by_friend":false,
+ "in_reply_to_post_id":null,
+ "in_rt_of_user_id":null,
+ "reply_retweet_distance":0,
+ "is_retweet_by_friend":false,
+ "favorited":false,
+ "all_retweets":0,
+ "text":"@ben_hay What course are you going, again?",
+ "created_at":"Thu Mar 31 15:17:45 +0100 2011",
+ "annotations":null,
+ "truncated":false,
+ "protected":false,
+ "coordinates":{
+ "coordinates":[
+ 52.4699784,
+ -3.8303771
+ ]
+ },