Hello.
I am writing with regards to a fixed effect in the usage of the “$” character. Please consider the following two queries.
Query1
import pandas as pd, numpy as np; from searchtweets import ResultStream, gen_rule_payload, load_credentials, collect_results,searchtweets
print 'Version: ', (searchtweets.__version__)
premium_search_args = load_credentials("~/.twitter_keys.yaml",account_type="premium")
rule = gen_rule_payload("AVAV", results_per_call=10);print 'Rule: ', rule
tweets = collect_results(rule,max_results=10,result_stream_args=premium_search_args)
print [tweets[0][key] for key in tweets[0].keys()]
Query2
import pandas as pd, numpy as np; from searchtweets import ResultStream, gen_rule_payload, load_credentials, collect_results,searchtweets
print 'Version: ', (searchtweets.__version__)
premium_search_args = load_credentials("~/.twitter_keys.yaml",account_type="premium")
rule = gen_rule_payload("$AVAV", results_per_call=10);print 'Rule: ', rule
tweets = collect_results(rule,max_results=10,result_stream_args=premium_search_args)
print [tweets[0][key] for key in tweets[0].keys()]
Output 1
['Sat May 12 22:10:41 +0000 2018',
995426060589240326,
'995426060589240326',
'Hvis Island ikke kan lide vikingesangen, så er den helt gal! #higherground #lowerpoints #avav #escdk',
'<a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a>',
False,
None,
None,
None,
None,
None,
{'id': 711495675,
'id_str': '711495675',
'name': 'Marita á Rógvi',
'screen_name': '_marogvi',
'location': 'København, Danmark',
'url': None,
'description': 'Stolt og stædig færing! Freelancejournalist for danske og færøske medier 🇫🇴🇩🇰',
'translator_type': 'none',
'protected': False,
'verified': False,
'followers_count': 371,
'friends_count': 659,
'listed_count': 14,
'favourites_count': 735,
'statuses_count': 615,
'created_at': 'Sat Oct 12 20:51:07 +0000 2013',
'utc_offset': None,
'time_zone': None,
'geo_enabled': True,
'lang': 'da',
'contributors_enabled': False,
'is_translator': False,
'profile_background_color': 'C0DEED',
'profile_background_image_url': 'http://pbs.twimg.com/profile_background_images/443057160662945792/BL8zZMqr.jpeg',
'profile_background_image_url_https': 'https://pbs.twimg.com/profile_background_images/443057160662945792/BL8zZMqr.jpeg',
'profile_background_tile': True,
'profile_link_color': '0084B4',
'profile_sidebar_border_color': '000000',
'profile_sidebar_fill_color': 'DDEEF6',
'profile_text_color': '333333',
'profile_use_background_image': True,
'profile_image_url': 'http://pbs.twimg.com/profile_images/928303665970139137/-IJaa_Ed_normal.jpg',
'profile_image_url_https': 'https://pbs.twimg.com/profile_images/928303665970139137/-IJaa_Ed_normal.jpg',
'profile_banner_url': 'https://pbs.twimg.com/profile_banners/711495675/1426538440',
'default_profile': False,
'default_profile_image': False,
'following': None,
'follow_request_sent': None,
'notifications': None},
None,
None,
None,
None,
False,
0,
0,
0,
4,
{'hashtags': [{'text': 'higherground', 'indices': [61, 74]},
{'text': 'lowerpoints', 'indices': [75, 87]},
{'text': 'avav', 'indices': [88, 93]},
{'text': 'escdk', 'indices': [94, 100]}],
'urls': [],
'user_mentions': [],
'symbols': []},
False,
False,
'low',
'da',
[{'tag': None}]]
Output 2
retrying request; current status code: 422
retrying request; current status code: 422
retrying request; current status code: 422
HTTP Error code: 422: There were errors processing your request: Reference to invalid operator 'cashtag'. Operator is not available in current product or product packaging. Must be from the list: [bounding_box, from, lang, place, place_country, point_radius, retweets_of, to, url, has:images, has:links, has:media, has:mentions, has:videos] (at position 1)
Rule payload: {'query': '$AVAV', 'maxResults': 10}
Output 1 is fine, but output 2 is not.
The difference between the two queries is simply the inclusion of “$” keyword argument. I believe my .yaml file and all else should be fine. Is there any special treatment I should be giving the “$”? I am aware I can do the query without the “$”, and subset with string splits. This, however, would increase the time and space complexity.
Thank you.