Skip to content

Commit

Permalink
Allow management of Twitter accounts via admin interface
Browse files Browse the repository at this point in the history
Bump required TwiterSearch version to 1.0+
  • Loading branch information
trendspotter committed Oct 8, 2017
1 parent ad13501 commit ab29181
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN apt-get update && apt-get install -y build-essential unzip curl python-pip p
python-numpy python-dateutil python-gdal python-yaml python-serial python-xlwt python-shapely python-pil python-gdal \
python-reportlab python-reportlab-accel python-tweepy python-xlrd python-pyth python-boto ansible

RUN pip install selenium\>=2.23.0 sunburnt\>=0.6 TwitterSearch\>=0.78.4 requests\>=2.3.0
RUN pip install selenium\>=2.23.0 sunburnt\>=0.6 TwitterSearch\>=1.0 requests\>=2.3.0

RUN curl -o web2py.zip https://codeload.github.com/web2py/web2py/zip/R-2.9.11 && unzip web2py.zip && mv web2py-R-2.9.11 /home/web2py && rm web2py.zip

Expand Down
7 changes: 1 addition & 6 deletions controllers/msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1409,12 +1409,7 @@ def postp(r, output):
return output
s3.postp = postp

s3db.configure(tablename,
listadd = False,
deletable = False,
)

return s3_rest_controller(deduplicate="", list_btn="")
return s3_rest_controller()

# -----------------------------------------------------------------------------
def inject_search_after_save(output):
Expand Down
10 changes: 5 additions & 5 deletions modules/s3/s3msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2398,12 +2398,12 @@ def twitter_search(search_id):
limitby=(0, 1)).first()

tso = TwitterSearch.TwitterSearchOrder()
tso.setKeywords(search_query.keywords.split(" "))
tso.setLanguage(search_query.lang)
tso.set_keywords(search_query.keywords.split(" "))
tso.set_language(search_query.lang)
# @ToDo Handle more than 100 results per page
# This may have to be changed upstream
tso.setCount(int(search_query.count))
tso.setIncludeEntities(search_query.include_entities)
tso.set_count(int(search_query.count))
tso.set_include_entities(search_query.include_entities)

try:
ts = TwitterSearch.TwitterSearch(
Expand All @@ -2423,7 +2423,7 @@ def twitter_search(search_id):
rtable.location_id.requires = None
update_super = s3db.update_super

for tweet in ts.searchTweetsIterable(tso):
for tweet in ts.search_tweets_iterable(tso):
user = tweet["user"]["screen_name"]
body = tweet["text"]
tweet_id = tweet["id_str"]
Expand Down
2 changes: 1 addition & 1 deletion optional_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ matplotlib>=1.1.1
# Warning: Survey unresolved dependency: PyRTF required if you want to export assessment/survey templates as a Word document
PyRTF>=0.45
# Warning: Message Parsing unresolved dependency: TwitterSearch required for fetching results from twitter keyword queries
TwitterSearch>=0.78.4
TwitterSearch>=1.0
# Warning: Messaging unresolved dependency: requests required for posting to Facebook
requests>=2.3.0
# Warning: Setup unresolved dependency: ansible required for Setup Module
Expand Down
2 changes: 2 additions & 0 deletions static/formats/s3csv/edu/school.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
L5......................gis_location.L5
Lat.....................gis_location.lat
Lon.....................gis_location.lon
Capacity................edu_school
Contact.................edu_school
Phone...................edu_school
Email...................edu_school
Website.................edu_school
Expand Down

0 comments on commit ab29181

Please sign in to comment.