You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a function that formats search API rules into valid json
213
217
queries called ``gen_rule_payload``. It has sensible defaults, such as
@@ -267,30 +271,45 @@ Let's see how it goes:
267
271
268
272
tweets = collect_results(rule,
269
273
max_results=100,
270
-
resut_stream_args=enterprise_search_args) # change this if you need to
274
+
result_stream_args=enterprise_search_args) # change this if you need to
271
275
272
276
By default, tweet payloads are lazily parsed into a ``Tweet`` object. An
273
277
overwhelming number of tweet attributes are made available directly, as
274
278
such:
275
279
276
280
.. code:: python
277
281
278
-
[print(unidecode(tweet.all_text)) for tweet in tweets[0:10]];
282
+
[print(tweet.all_text) for tweet in tweets[0:10]];
279
283
280
284
281
285
.. parsed-literal::
282
286
283
-
3 years ago today, beyonce surprise dropped the fastest selling album on itunes EVER then posted this on instagram like nothing happened https://t.co/F416MG2aCZ
284
-
.@Beyonce sells OVER 80,000 copies of her new album in 3 hours: http://t.co/PKSARIvE67
285
-
Perfect Duet with Beyonce and Ed Sheeran is the perfect combo ughhh
286
-
As we celebrate the anniversary of 'BEYONCE,' I would just like to say that it is easily THE swankiest vinyl I own.
287
-
Beyonce talks about natural disasters and climate change at 'Hand In Hand' Harvey Relief Telethon https://t.co/rP0wTIoUGx
288
-
Perfect Duet (with Beyonce) by Ed Sheeran is number 2 in Austria #iTunes top 100 songs https://t.co/qqlBFLHpzl
289
-
beyonce has truly delivered within the past week https://t.co/DDboQFBIgG
290
-
I'll never forget waking up in the morning to a number of tweets from my friends. I was so confused. I switched on my computer, got onto iTunes and there it was... Beyonce EVERYWHERE! I screamed & jumped up & down in excitement and disbelief! Iconic! https://t.co/peN7Oyc5po
291
-
Beyonce explaining her intent behind the BEYONCE visual album & how she wanted to reinstate the idea of an album release as a significant, exciting event which had lost meaning in the face of hype created around singles. https://t.co/pK2MB35vYl
292
-
i had like 25 dollars in my account and used half of them to buy that album. songs AND VIDEOS??? BEYONCE WYD???? Man what a night.
293
-
Ed Sheeran released the song without Beyonce and it didn't go #1. He released the song with Beyonce and it did go #1. it's clear and simple. he needed her to go #1 https://t.co/RteEZBzJu8
287
+
That deep sigh Beyoncé took once she realized she wouldn’t be able to get the earpiece out of her hair before the dance break 😂. https://t.co/dU1K2KMT7i
288
+
4 Years ago today, "BEYONCÉ" by Beyoncé was surprise released. It received acclaim from critics, debuted at #1 and certified 2x Platinum in the US. https://t.co/wB3C7DuX9o
289
+
me mata la gente que se cree superior por sus gustos de música escuches queen beyonce o el polaco no sos mas ni menos que nadie
290
+
I’m literally not Beyoncé https://t.co/LwIkllCx6P
291
+
#BEYONCÉ ‣ 𝐌𝐄𝐀𝐃𝐃𝐅𝐀𝐍 𝐎𝐅𝐈𝐂𝐈𝐀𝐋 - I Am... 𝐖𝐎𝐑𝐋𝐃 𝐓𝐎𝐔𝐑! https://t.co/TyyeDdXKiM
292
+
Beyoncé on how nervous she was to release her self-titled... https://t.co/fru23c6DYC
293
+
AAAA ansiosa por esse feat da Beyoncé com Jorge Ben Jor <3 https://t.co/NkKJhC9JUd
294
+
I am world tour, the Beyonce experience, revamped hmt. https://t.co/pb07eMyNka
295
+
Tell me what studio versions of any artists would u like me to do? https://t.co/Z6YWsAJuhU
296
+
Billboard's best female artists over the last decade:
297
+
298
+
2017: Ariana Grande
299
+
2016: Adele
300
+
2015: Taylor Swift
301
+
2014: Katy Perry
302
+
2013: Taylor Swift
303
+
2012: Adele
304
+
2011: Adele
305
+
2010: Lady Gaga
306
+
2009: Taylor Swift
307
+
2008: Rihanna
308
+
309
+
Beyonce = 0
310
+
311
+
Taylor Swift = 3 👑
312
+
Beyoncé explaining her intent behind the BEYONCÉ visual album & how she wanted to reinstate the idea of an album release as a significant, exciting event which had lost meaning in the face of hype created around singles. 👑 https://t.co/pK2MB35vYl
294
313
295
314
296
315
.. code:: python
@@ -300,16 +319,16 @@ such:
300
319
301
320
.. parsed-literal::
302
321
303
-
2017-10-27 18:22:07
304
-
2017-10-27 18:17:37
305
-
2017-10-27 01:25:39
306
-
2017-10-26 14:24:05
307
-
2017-10-26 13:50:40
308
-
2017-10-26 13:36:19
309
-
2017-10-26 13:35:57
310
-
2017-10-26 02:40:25
311
-
2017-10-26 00:07:23
312
-
2017-10-25 20:15:19
322
+
2017-12-13 21:18:17
323
+
2017-12-13 21:18:16
324
+
2017-12-13 21:18:16
325
+
2017-12-13 21:18:15
326
+
2017-12-13 21:18:15
327
+
2017-12-13 21:18:13
328
+
2017-12-13 21:18:12
329
+
2017-12-13 21:18:12
330
+
2017-12-13 21:18:11
331
+
2017-12-13 21:18:10
313
332
314
333
315
334
.. code:: python
@@ -319,16 +338,16 @@ such:
319
338
320
339
.. parsed-literal::
321
340
341
+
Twitter for Android
342
+
Twitter for Android
343
+
Twitter for Android
322
344
Twitter for iPhone
345
+
Meadd
323
346
Twitter for iPhone
347
+
Twitter for Android
324
348
Twitter for iPhone
325
349
Twitter for iPhone
326
-
Twitter for iPhone
327
-
Twitter for iPhone
328
-
Twitter for iPhone
329
-
Twitter for iPhone
330
-
Twitter for iPhone
331
-
Twitter for iPhone
350
+
Twitter for Android
332
351
333
352
334
353
Voila, we have some tweets. For interactive environments and other cases
@@ -349,9 +368,7 @@ stop on number of pages to limit your API call usage.
349
368
max_results=500,
350
369
max_pages=1,
351
370
**premium_search_args)
352
-
353
-
.. code:: python
354
-
371
+
355
372
print(rs)
356
373
357
374
@@ -384,39 +401,42 @@ easily extractable.
384
401
.. code:: python
385
402
386
403
# using unidecode to prevent emoji/accents printing
387
-
[print(unidecode(tweet.all_text)) for tweet in tweets[0:10]];
404
+
[print(tweet.all_text) for tweet in tweets[0:10]];
388
405
389
406
390
407
.. parsed-literal::
391
408
392
-
BEYONCE WANTS ME DEAD https://t.co/6ztOJpz9dt
393
-
in my college dorm and the Beyonce album popped up on iTunes and I thought it was fake because there was a Drake feature and I was like "bey would never" LITTLE DID I KNOW.... then this bitch gon post vegan cupcakes on instagram like she didn't just fuck the industry up... https://t.co/tRNo4O11uh
394
-
When in doubt , watch a Beyonce documentary .
395
-
Beyonce changed the game w/ that digital drop 4 years ago today!
409
+
Everyone: *still dragging Jay for cheating*
410
+
411
+
Beyoncé: https://t.co/2z1ltlMQiJ
412
+
Beyoncé changed the game w/ that digital drop 4 years ago today! 🎉
396
413
397
-
* #1 debut on Billboard
398
-
* Sold 617K in the US / over 828K WW in only 3 days
399
-
* Fastest-selling album on iTunes of all time
400
-
* Reached #1 in 118 countries
401
-
* Widespread acclaim; hailed as her magnum opus https://t.co/lDCdVs6em3
402
-
Beyonce x JAY Z https://t.co/czJoAwt4eJ
403
-
On this very day 4 years ago, as we were finishing up Scandal season finale and putting on our bonnets and Durags to sleep Beyonce said https://t.co/YFBGRmTWVY
414
+
• #1 debut on Billboard
415
+
• Sold 617K in the US / over 828K WW in only 3 days
416
+
• Fastest-selling album on iTunes of all time
417
+
• Reached #1 in 118 countries
418
+
• Widespread acclaim; hailed as her magnum opus https://t.co/lDCdVs6em3
419
+
Beyoncé 🔥 #444Tour https://t.co/sCvZzjLwqx
420
+
Se presentan casos de feminismo pop basado en sugerencias de artistas famosos en turno, Emma Watson, Beyoncé.
421
+
Beyonce. Are you kidding me with this?! #Supreme #love #everything
422
+
Dear Beyoncé, https://t.co/5visfVK2LR
423
+
At this time 4 years ago today, Beyoncé released her self-titled album BEYONCÉ exclusively on the iTunes Store without any prior announcement. The album remains the ONLY album in history to reach #1 in 118 countries & the fastest-selling album in the history of the iTunes Store. https://t.co/ZZb4QyQYf0
424
+
4 years ago today, Beyoncé released her self-titled visual album "BEYONCÉ" and shook up the music world forever. 🙌🏿 https://t.co/aGtUSq9R3u
404
425
Everyone: *still dragging Jay for cheating*
405
426
406
-
Beyonce: https://t.co/2z1ltlMQiJ
407
-
quem e que tem dificuldades a admitir que a beyonce e a voz mais iconica da nossa geracao
408
-
Beyonce on how nervous she was to release her self-titled... https://t.co/fru23c6DYC
409
-
i'm bout to jump into my feelings because four years ago today i was so broke and dusty and beyonce came into my life and took the pain away.
427
+
Beyoncé: https://t.co/2z1ltlMQiJ
428
+
And Beyonce hasn't had a solo #1 hit since the Bush administration soooo... https://t.co/WCd7ni8DwN
410
429
411
430
412
431
Counts API
413
432
----------
414
433
415
434
We can also use the counts api to get counts of tweets that match our
416
435
rule. Each request will return up to *30* results, and each count
417
-
request can be done on a minutely, hourly, or daily basis. There is a
418
-
utility function that will convert your regular endpoint to the count
419
-
endpoint.
436
+
request can be done on a minutely, hourly, or daily basis. The
437
+
underlying ``ResultStream`` object will handle converting your endpoint
438
+
to the count endpoint, and you have to specify the ``count_bucket``
439
+
argument when making a rule to use it.
420
440
421
441
The process is very similar to grabbing tweets, but has some minor
Our results are pretty straightforward and can be rapidly used.
434
454
@@ -441,27 +461,27 @@ Our results are pretty straightforward and can be rapidly used.
441
461
442
462
.. parsed-literal::
443
463
444
-
[{'count': 68745, 'timePeriod': '201712130000'},
445
-
{'count': 95305, 'timePeriod': '201712120000'},
446
-
{'count': 114641, 'timePeriod': '201712110000'},
447
-
{'count': 166070, 'timePeriod': '201712100000'},
448
-
{'count': 102049, 'timePeriod': '201712090000'},
449
-
{'count': 87710, 'timePeriod': '201712080000'},
450
-
{'count': 196157, 'timePeriod': '201712070000'},
451
-
{'count': 210664, 'timePeriod': '201712060000'},
452
-
{'count': 88572, 'timePeriod': '201712050000'},
453
-
{'count': 96794, 'timePeriod': '201712040000'},
464
+
[{'count': 85660, 'timePeriod': '201712130000'},
465
+
{'count': 95231, 'timePeriod': '201712120000'},
466
+
{'count': 114540, 'timePeriod': '201712110000'},
467
+
{'count': 165964, 'timePeriod': '201712100000'},
468
+
{'count': 102022, 'timePeriod': '201712090000'},
469
+
{'count': 87630, 'timePeriod': '201712080000'},
470
+
{'count': 195794, 'timePeriod': '201712070000'},
471
+
{'count': 209629, 'timePeriod': '201712060000'},
472
+
{'count': 88742, 'timePeriod': '201712050000'},
473
+
{'count': 96795, 'timePeriod': '201712040000'},
454
474
{'count': 177595, 'timePeriod': '201712030000'},
455
475
{'count': 120102, 'timePeriod': '201712020000'},
456
-
{'count': 186758, 'timePeriod': '201712010000'},
476
+
{'count': 186759, 'timePeriod': '201712010000'},
457
477
{'count': 151212, 'timePeriod': '201711300000'},
458
478
{'count': 79311, 'timePeriod': '201711290000'},
459
479
{'count': 107175, 'timePeriod': '201711280000'},
460
480
{'count': 58192, 'timePeriod': '201711270000'},
461
481
{'count': 48327, 'timePeriod': '201711260000'},
462
-
{'count': 59638, 'timePeriod': '201711250000'},
482
+
{'count': 59639, 'timePeriod': '201711250000'},
463
483
{'count': 85201, 'timePeriod': '201711240000'},
464
-
{'count': 91542, 'timePeriod': '201711230000'},
484
+
{'count': 91544, 'timePeriod': '201711230000'},
465
485
{'count': 64129, 'timePeriod': '201711220000'},
466
486
{'count': 92065, 'timePeriod': '201711210000'},
467
487
{'count': 101617, 'timePeriod': '201711200000'},
@@ -471,7 +491,7 @@ Our results are pretty straightforward and can be rapidly used.
471
491
{'count': 81849, 'timePeriod': '201711160000'},
472
492
{'count': 58423, 'timePeriod': '201711150000'},
473
493
{'count': 78004, 'timePeriod': '201711140000'},
474
-
{'count': 118078, 'timePeriod': '201711130000'}]
494
+
{'count': 118077, 'timePeriod': '201711130000'}]
475
495
476
496
477
497
@@ -505,24 +525,105 @@ method; please see your developer console for details.
505
525
506
526
.. code:: python
507
527
508
-
#using unidecode only to
509
-
[print(unidecode(tweet.all_text)) for tweet in tweets[0:10]];
528
+
#usiing unidecode only to
529
+
[print(tweet.all_text) for tweet in tweets[0:10]];
510
530
511
531
512
532
.. parsed-literal::
513
533
514
534
More clarity on our private information policy and enforcement. Working to build as much direct context into the product too https://t.co/IrwBexPrBA
515
-
To provide more clarity on our private information policy, we've added specific examples of what is/is not a violation and insight into what we need to remove this type of content from the service. https://t.co/NGx5hh2tTQ
535
+
To provide more clarity on our private information policy, we’ve added specific examples of what is/is not a violation and insight into what we need to remove this type of content from the service. https://t.co/NGx5hh2tTQ
516
536
Launching violent groups and hateful images/symbols policy on November 22nd https://t.co/NaWuBPxyO5
517
-
We will now launch our policies on violent groups and hateful imagery and hate symbols on Nov 22. During the development process, we received valuable feedback that we're implementing before these are published and enforced. See more on our policy development process here https://t.co/wx3EeH39BI
537
+
We will now launch our policies on violent groups and hateful imagery and hate symbols on Nov 22. During the development process, we received valuable feedback that we’re implementing before these are published and enforced. See more on our policy development process here 👇 https://t.co/wx3EeH39BI
518
538
@WillStick @lizkelley Happy birthday Liz!
519
539
Off-boarding advertising from all accounts owned by Russia Today (RT) and Sputnik.
520
540
521
-
We're donating all projected earnings ($1.9mm) to support external research into the use of Twitter in elections, including use of malicious automation and misinformation. https://t.co/zIxfqqXCZr
541
+
We’re donating all projected earnings ($1.9mm) to support external research into the use of Twitter in elections, including use of malicious automation and misinformation. https://t.co/zIxfqqXCZr
0 commit comments