forked from ropensci/rtweet
/
FAQ.html
218 lines (196 loc) · 11.4 KB
/
FAQ.html
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FAQ • rtweet</title>
<!-- jquery --><script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js" integrity="sha384-cV+rhyOuRHc9Ub/91rihWcGmMmCXDeksTtCihMupQHSsi8GIIRDG0ThDc3HGQFJ3" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><link href="../extra.css" rel="stylesheet">
<meta property="og:title" content="FAQ">
<meta property="og:description" content="">
<meta property="og:image" content="https://rtweet.info/logo.png">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">rtweet</a>
<span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released package">0.6.8.9000</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/FAQ.html">FAQ</a>
</li>
<li>
<a href="../articles/auth.html">Obtaining and using access tokens</a>
</li>
<li>
<a href="../articles/intro.html">Intro to rtweet: Collecting Twitter Data</a>
</li>
<li>
<a href="../articles/stream.html">Live streaming tweets</a>
</li>
</ul>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/mkearney/rtweet">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1>FAQ</h1>
<h3 class="subtitle">rtweet: Collecting Twitter Data</h3>
<div class="hidden name"><code>FAQ.Rmd</code></div>
</div>
<div id="error-in-init_oauth1-0---" class="section level2">
<h2 class="hasAnchor">
<a href="#error-in-init_oauth1-0---" class="anchor"></a><code>Error in init_oauth1.0(...</code>
</h2>
<div id="context" class="section level4">
<h4 class="hasAnchor">
<a href="#context" class="anchor"></a>Context</h4>
<p>Occurs when attempting to create a token</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="co">## these are fake keys</span></a>
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="co">#> create_token(</span></a>
<a class="sourceLine" id="cb1-3" data-line-number="3"><span class="co">#> app = "rtweet_token",</span></a>
<a class="sourceLine" id="cb1-4" data-line-number="4"><span class="co">#> consumer_key = "XYznzPFOFZR2a39FwWKN1Jp41",</span></a>
<a class="sourceLine" id="cb1-5" data-line-number="5"><span class="co">#> consumer_secret = "CtkGEWmSevZqJuKl6HHrBxbCybxI1xGLqrD5ynPd9jG0SoHZbD")</span></a>
<a class="sourceLine" id="cb1-6" data-line-number="6"><span class="co"># `Error in init_oauth1.0(endpoint, app, permission = params$permission) :</span></a>
<a class="sourceLine" id="cb1-7" data-line-number="7"><span class="co"># client error: (401) Unauthorized`</span></a></code></pre></div>
</div>
<div id="solutions" class="section level4">
<h4 class="hasAnchor">
<a href="#solutions" class="anchor"></a>Solutions</h4>
<ol style="list-style-type: decimal">
<li>Make sure you have <strong>at least</strong> rtweet version <code>0.6.6</code>
</li>
<li>Check callback URL</li>
<li>Make sure <code>Callback URL</code> option in “Settings” tab at <a href="https://apps.twitter.com" class="uri">https://apps.twitter.com</a> <strong>match exactly</strong> the following: <code>http://127.0.0.1:1410</code>
</li>
<li>Make sure API keys <strong>match exactly</strong> the values for your Twitter app (found under the <code>Keys and Access Tokens</code> tab at <a href="https://apps.twitter.com" class="uri">https://apps.twitter.com</a>)</li>
<li>In your app page at <a href="https://apps.twitter.com/" class="uri">https://apps.twitter.com/</a> under the <code>Keys and Access Tokens</code> tab, click <code>Regenerate Consumer Key and Secret</code>. Create a new token using the new key and secret.</li>
<li>Update the <strong>{httr}</strong> package</li>
<li>Update R</li>
</ol>
</div>
</div>
<div id="error-in-oauth_listener---" class="section level2">
<h2 class="hasAnchor">
<a href="#error-in-oauth_listener---" class="anchor"></a><code>Error in oauth_listener(...</code>
</h2>
<div id="context-1" class="section level4">
<h4 class="hasAnchor">
<a href="#context-1" class="anchor"></a>Context</h4>
<p>Occurs when attempting to create a token (using in-browser authorization method)</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" data-line-number="1"><span class="co">## these are fake keys</span></a>
<a class="sourceLine" id="cb2-2" data-line-number="2"><span class="co">#> create_token(</span></a>
<a class="sourceLine" id="cb2-3" data-line-number="3"><span class="co">#> app = "rtweet_token",</span></a>
<a class="sourceLine" id="cb2-4" data-line-number="4"><span class="co">#> consumer_key = "XYznzPFOFZR2a39FwWKN1Jp41",</span></a>
<a class="sourceLine" id="cb2-5" data-line-number="5"><span class="co">#> consumer_secret = "CtkGEWmSevZqJuKl6HHrBxbCybxI1xGLqrD5ynPd9jG0SoHZbD")</span></a>
<a class="sourceLine" id="cb2-6" data-line-number="6"><span class="co">#Error in oauth_listener(authorize_url, is_interactive) :</span></a>
<a class="sourceLine" id="cb2-7" data-line-number="7"><span class="co"># httpuv package required to capture OAuth credentials.</span></a></code></pre></div>
</div>
<div id="solutions-1" class="section level4">
<h4 class="hasAnchor">
<a href="#solutions-1" class="anchor"></a>Solutions</h4>
<ol style="list-style-type: decimal">
<li>Install the <strong>{httpuv}</strong> package</li>
</ol>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="kw">install.packages</span>(<span class="st">"httpuv"</span>)</a></code></pre></div>
</div>
</div>
<div id="warning-89---invalid-or-expired-token-" class="section level2">
<h2 class="hasAnchor">
<a href="#warning-89---invalid-or-expired-token-" class="anchor"></a><code>Warning: 89 - Invalid or expired token.</code>
</h2>
<div id="context-2" class="section level4">
<h4 class="hasAnchor">
<a href="#context-2" class="anchor"></a>Context</h4>
<p>Occurs when sending request to Twitter API. It means you have invalid or expired keys stored in access token.</p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" data-line-number="1"><span class="co">#> search_tweets("lang:en")</span></a>
<a class="sourceLine" id="cb4-2" data-line-number="2"><span class="co">#Warning: 89 - Invalid or expired token.</span></a></code></pre></div>
</div>
<div id="solutions-2" class="section level4">
<h4 class="hasAnchor">
<a href="#solutions-2" class="anchor"></a>Solutions</h4>
<ol style="list-style-type: decimal">
<li>Create new token using the keys from your previously created Twitter application found at <a href="https://apps.twitter.com" class="uri">https://apps.twitter.com</a>
</li>
<li>In your app page at <a href="https://apps.twitter.com/" class="uri">https://apps.twitter.com/</a> under the <code>Keys and Access Tokens</code> tab, click <code>Regenerate Consumer Key and Secret</code>. Create a new token using the new key and secret.</li>
</ol>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="co">## these are fake keys</span></a>
<a class="sourceLine" id="cb5-2" data-line-number="2"><span class="co">#> create_token(</span></a>
<a class="sourceLine" id="cb5-3" data-line-number="3"><span class="co">#> app = "rtweet_token",</span></a>
<a class="sourceLine" id="cb5-4" data-line-number="4"><span class="co">#> consumer_key = "XYznzPFOFZR2a39FwWKN1Jp41",</span></a>
<a class="sourceLine" id="cb5-5" data-line-number="5"><span class="co">#> consumer_secret = "CtkGEWmSevZqJuKl6HHrBxbCybxI1xGLqrD5ynPd9jG0SoHZbD")</span></a></code></pre></div>
</div>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<div id="tocnav">
<h2 class="hasAnchor">
<a href="#tocnav" class="anchor"></a>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#error-in-init_oauth1-0---"><code>Error in init_oauth1.0(...</code></a></li>
<li><a href="#error-in-oauth_listener---"><code>Error in oauth_listener(...</code></a></li>
<li><a href="#warning-89---invalid-or-expired-token-"><code>Warning: 89 - Invalid or expired token.</code></a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p>Developed by <a href="https://mikewk.com">Michael W. Kearney</a>.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>