Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
Add number of replies
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottl committed Nov 28, 2018
1 parent 34078e1 commit c4ea631
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion GetOldTweets3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from . import models
from . import manager

__version__ = '0.0.7'
__version__ = '0.0.8'
1 change: 1 addition & 0 deletions GetOldTweets3/manager/TweetManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def getTweets(tweetCriteria, receiveBuffer=None, bufferLength=100, proxy=None, d
.replace('# ', '#').replace('@ ', '@').replace('$ ', '$')
tweet.retweets = int(tweetPQ("span.ProfileTweet-action--retweet span.ProfileTweet-actionCount").attr("data-tweet-stat-count").replace(",", ""))
tweet.favorites = int(tweetPQ("span.ProfileTweet-action--favorite span.ProfileTweet-actionCount").attr("data-tweet-stat-count").replace(",", ""))
tweet.replies = int(tweetPQ("span.ProfileTweet-action--reply span.ProfileTweet-actionCount").attr("data-tweet-stat-count").replace(",", ""))
tweet.id = tweetPQ.attr("data-tweet-id")
tweet.permalink = 'https://twitter.com' + tweetPQ.attr("data-permalink-path")
tweet.author_id = int(tweetPQ("a.js-user-profile-link").attr("data-user-id"))
Expand Down
3 changes: 2 additions & 1 deletion bin/GetOldTweets3
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def main(argv):
tweetCriteria.username = usernames.pop()

outputFile = open(outputFileName, "w+", encoding="utf8")
outputFile.write('date,username,to,retweets,favorites,text,geo,mentions,hashtags,id,permalink\n')
outputFile.write('date,username,to,replies,retweets,favorites,text,geo,mentions,hashtags,id,permalink\n')

cnt = 0
def receiveBuffer(tweets):
Expand All @@ -145,6 +145,7 @@ def main(argv):
data = [t.date.strftime("%Y-%m-%d %H:%M:%S"),
t.username,
t.to or '',
t.replies,
t.retweets,
t.favorites,
'"'+t.text.replace('"','""')+'"',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name="GetOldTweets3",
version="0.0.7",
version="0.0.8",
author="Dmitry Mottl",
author_email="[email protected]",
license='MIT',
Expand Down

0 comments on commit c4ea631

Please sign in to comment.