aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/demos/tweetsearch/doc
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2013-06-21 10:50:48 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-26 10:16:27 +0200
commitc9ec0c206544b37139057932a6dceed88565a75f (patch)
tree90ef92716ec84e074497018e7046ae0b7521bc4d /examples/quick/demos/tweetsearch/doc
parent1099b26535fedbaaa134ccb63310362951fce847 (diff)
Doc: Update Tweet Search Demo to use Twitter Search API v1.1
Twitter REST API v1 is no longer supported. This change updates the Tweet Search Demo to use the new version (v1.1). Specifically, - Use of OAuth tokens (authentication required in v1.1) - JSON parsing for results instead of XML - Use of url/hashtag/username entities returned in search results Also, update the documentation to discuss authentication and registering the application to dev.twitter.com. Task-number: QTBUG-31745 Change-Id: I00cd7b07f065babb03483daabe8df22f22995c29 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'examples/quick/demos/tweetsearch/doc')
-rw-r--r--examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc45
1 files changed, 44 insertions, 1 deletions
diff --git a/examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc b/examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc
index 9ba252fcb5..a56ed0d7e9 100644
--- a/examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc
+++ b/examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc
@@ -32,5 +32,48 @@
\brief A Twitter search client with 3D effects.
\image qtquick-demo-tweetsearch-med-1.png
\image qtquick-demo-tweetsearch-med-2.png
-*/
+ \section1 Demo Introduction
+
+ The Tweet Search demo searches items posted to Twitter service
+ using a number of query parameters. Search can be done for tweets
+ from a specified user, a hashtag or a search phrase.
+
+ The search result is a list of items showing the contents of the
+ tweet as well as the name and image of the user who posted it.
+ Hashtags, names and links in the content are clickable. Clicking
+ on the image will flip the item to reveal more information.
+
+ \section1 Running the Demo
+
+ Tweet Search uses Twitter API v1.1 for running seaches.
+
+ \section2 Authentication
+
+ Each request must be authenticated on behalf of the application.
+ For demonstration purposes, the application uses a hard-coded
+ token for identifying itself to the Twitter service. However, this
+ token is subject to rate limits for the number of requests as well
+ as possible expiration.
+
+ If you are having authentication or rate limit problems running the
+ demo, obtain a set of application-specific tokens (consumer
+ key and consumer secret) by registering a new application on
+ \l{https://dev.twitter.com/apps}.
+
+ Type in the two token values in \e {TweetsModel.qml}:
+
+ \snippet demos/tweetsearch/content/TweetsModel.qml auth tokens
+
+ Rebuild and run the demo.
+
+ \section2 JSON Parsing
+
+ Search results are returned in JSON (JavaScript Object Notation)
+ format. \c TweetsModel uses an \l XMLHTTPRequest object to send
+ an HTTP GET request, and calls JSON.parse() on the returned text
+ string to convert it to a JavaScript object. Each object
+ representing a tweet is then added to a \l ListModel:
+
+ \snippet demos/tweetsearch/content/TweetsModel.qml requesting
+*/