This file is indexed.

/usr/share/qt5/doc/qtquick/qtquick-demos-tweetsearch-example.html is in qtdeclarative5-doc-html 5.2.1-3ubuntu15.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- tweetsearch.qdoc -->
  <title>Qt Quick Demo - Tweet Search | QtQuick 5.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
    <div class="main">
    <div class="main-rounded">
        <div class="navigationbar">
        <ul>
<li>Qt 5.2</li>
<li><a href="qtquick-index.html">Qt Quick</a></li>
<li>Qt Quick Demo - Tweet Search</li>
<li id="buildversion">
Qt 5.2.1 Reference Documentation</li>
    </ul>
    </div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#demo-introduction">Demo Introduction</a></li>
<li class="level1"><a href="#running-the-demo">Running the Demo</a></li>
<li class="level2"><a href="#authentication">Authentication</a></li>
<li class="level2"><a href="#json-parsing">JSON Parsing</a></li>
</ul>
</div>
<h1 class="title">Qt Quick Demo - Tweet Search</h1>
<span class="subtitle"></span>
<!-- $$$demos/tweetsearch-description -->
<div class="descr"> <a name="details"></a>
<p>A Twitter search client with 3D effects.<p class="centerAlign"><img src="images/qtquick-demo-tweetsearch-med-1.png" alt="" /></p><p class="centerAlign"><img src="images/qtquick-demo-tweetsearch-med-2.png" alt="" /></p><a name="demo-introduction"></a>
<h2>Demo Introduction</h2>
<p>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.</p>
<p>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.</p>
<a name="running-the-demo"></a>
<h2>Running the Demo</h2>
<p>Tweet Search uses Twitter API v1.1 for running seaches.</p>
<a name="authentication"></a>
<h3>Authentication</h3>
<p>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.</p>
<p>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 <a href="https://dev.twitter.com/apps">https://dev.twitter.com/apps</a>.</p>
<p>Type in the two token values in <i>TweetsModel.qml</i>:</p>
<pre class="qml">    property <span class="type">string</span> <span class="name">consumerKey</span> : <span class="string">&quot;&quot;</span>
    property <span class="type">string</span> <span class="name">consumerSecret</span> : <span class="string">&quot;&quot;</span></pre>
<p>Rebuild and run the demo.</p>
<a name="json-parsing"></a>
<h3>JSON Parsing</h3>
<p>Search results are returned in JSON (JavaScript Object Notation) format. <tt>TweetsModel</tt> uses an 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 <a href="qtquick-modelviewsdata-modelview.html#listmodel">ListModel</a>:</p>
<pre class="qml">        var <span class="name">req</span> = new <span class="name">XMLHttpRequest</span>;
        <span class="name">req</span>.<span class="name">open</span>(<span class="string">&quot;GET&quot;</span>, <span class="string">&quot;https://api.twitter.com/1.1/search/tweets.json?from=&quot;</span> <span class="operator">+</span> <span class="name">from</span> <span class="operator">+</span>
                        <span class="string">&quot;&amp;count=10&amp;q=&quot;</span> <span class="operator">+</span> <span class="name">encodePhrase</span>(<span class="name">phrase</span>));
        <span class="name">req</span>.<span class="name">setRequestHeader</span>(<span class="string">&quot;Authorization&quot;</span>, <span class="string">&quot;Bearer &quot;</span> <span class="operator">+</span> <span class="name">bearerToken</span>);
        <span class="name">req</span>.<span class="name">onreadystatechange</span> <span class="operator">=</span> <span class="keyword">function</span>() {
            <span class="name">status</span> <span class="operator">=</span> <span class="name">req</span>.<span class="name">readyState</span>;
            <span class="keyword">if</span> (<span class="name">status</span> <span class="operator">===</span> <span class="name">XMLHttpRequest</span>.<span class="name">DONE</span>) {
                var <span class="name">objectArray</span> = <span class="name">JSON</span>.<span class="name">parse</span>(<span class="name">req</span>.<span class="name">responseText</span>);
                <span class="keyword">if</span> (<span class="name">objectArray</span>.<span class="name">errors</span> <span class="operator">!==</span> <span class="name">undefined</span>)
                    <span class="name">console</span>.<span class="name">log</span>(<span class="string">&quot;Error fetching tweets: &quot;</span> <span class="operator">+</span> <span class="name">objectArray</span>.<span class="name">errors</span>[<span class="number">0</span>].<span class="name">message</span>)
                <span class="keyword">else</span> {
                    <span class="keyword">for</span> (<span class="keyword">var</span> <span class="name">key</span> in <span class="name">objectArray</span>.<span class="name">statuses</span>) {
                        var <span class="name">jsonObject</span> = <span class="name">objectArray</span>.<span class="name">statuses</span>[<span class="name">key</span>];
                        <span class="name">tweets</span>.<span class="name">append</span>(<span class="name">jsonObject</span>);
                    }
                }
                <span class="keyword">if</span> (<span class="name">wasLoading</span> <span class="operator">==</span> <span class="number">true</span>)
                    <span class="name">wrapper</span>.<span class="name">isLoaded</span>()
            }
            <span class="name">wasLoading</span> <span class="operator">=</span> (<span class="name">status</span> <span class="operator">===</span> <span class="name">XMLHttpRequest</span>.<span class="name">LOADING</span>);
        }
        <span class="name">req</span>.<span class="name">send</span>();</pre>
<p>Files:</p>
<ul>
<li><a href="qtquick-demos-tweetsearch-tweetsearch-qml.html">demos/tweetsearch/tweetsearch.qml</a></li>
<li><a href="qtquick-demos-tweetsearch-content-flipbar-qml.html">demos/tweetsearch/content/FlipBar.qml</a></li>
<li><a href="qtquick-demos-tweetsearch-content-lineinput-qml.html">demos/tweetsearch/content/LineInput.qml</a></li>
<li><a href="qtquick-demos-tweetsearch-content-listfooter-qml.html">demos/tweetsearch/content/ListFooter.qml</a></li>
<li><a href="qtquick-demos-tweetsearch-content-listheader-qml.html">demos/tweetsearch/content/ListHeader.qml</a></li>
<li><a href="qtquick-demos-tweetsearch-content-searchdelegate-qml.html">demos/tweetsearch/content/SearchDelegate.qml</a></li>
<li><a href="qtquick-demos-tweetsearch-content-tweetdelegate-qml.html">demos/tweetsearch/content/TweetDelegate.qml</a></li>
<li><a href="qtquick-demos-tweetsearch-content-tweetsmodel-qml.html">demos/tweetsearch/content/TweetsModel.qml</a></li>
<li><a href="qtquick-demos-tweetsearch-content-tweetsearch-js.html">demos/tweetsearch/content/tweetsearch.js</a></li>
<li><a href="qtquick-demos-tweetsearch-main-cpp.html">demos/tweetsearch/main.cpp</a></li>
<li><a href="qtquick-demos-tweetsearch-tweetsearch-pro.html">demos/tweetsearch/tweetsearch.pro</a></li>
<li><a href="qtquick-demos-tweetsearch-tweetsearch-qmlproject.html">demos/tweetsearch/tweetsearch.qmlproject</a></li>
<li><a href="qtquick-demos-tweetsearch-tweetsearch-qrc.html">demos/tweetsearch/tweetsearch.qrc</a></li>
</ul>
</div>
<!-- @@@demos/tweetsearch -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
   subsidiaries. Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Digia, Qt and their respective logos are trademarks of Digia Plc     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>