Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joined date #149

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Type "help", "copyright", "credits" or "license" for more information.
>>> from twitter_scraper import Profile
>>> profile = Profile("bugraisguzar")
>>> profile.to_dict()
{'name': 'Buğra İşgüzar', 'username': 'bugraisguzar', 'birthday': None, 'biography': 'geliştirici@peptr', 'website': 'bisguzar.com', 'profile_photo': 'https://pbs.twimg.com/profile_images/1199305322474745861/nByxOcDZ_400x400.jpg', 'banner_photo': 'https://pbs.twimg.com/profile_banners/1019138658/1555346657/1500x500', 'likes_count': 2512, 'tweets_count': 756, 'followers_count': 483, 'following_count': 255, 'is_verified': False, 'is_private': False}
{'name': 'Buğra İşgüzar', 'username': 'bugraisguzar', 'birthday': None, 'biography': 'geliştirici@peptr', 'website': 'bisguzar.com', 'profile_photo': 'https://pbs.twimg.com/profile_images/1199305322474745861/nByxOcDZ_400x400.jpg', 'banner_photo': 'https://pbs.twimg.com/profile_banners/1019138658/1555346657/1500x500', 'likes_count': 2512, 'tweets_count': 756, 'followers_count': 483, 'following_count': 255, 'is_verified': False, 'is_private': False, 'user_id': '1019138658', 'joined_date': 'December 2012'}
```


Expand Down
9 changes: 8 additions & 1 deletion twitter_scraper/modules/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class Profile:
- following_count
- is_verified
- is_private
-joined_date

"""

def __init__(self, username):
Expand Down Expand Up @@ -65,6 +67,9 @@ def __parse_profile(self, page):
if not self.location:
self.location = None

self.joined_date = html.find(".ProfileHeaderCard-joinDateText")[0].text.replace('Joined ', '')
ozanbayram marked this conversation as resolved.
Show resolved Hide resolved
ozanbayram marked this conversation as resolved.
Show resolved Hide resolved


self.birthday = html.find(".ProfileHeaderCard-birthdateText")[0].text
if self.birthday:
self.birthday = self.birthday.replace("Born ", "")
Expand Down Expand Up @@ -133,6 +138,7 @@ def to_dict(self):
following_count=self.following_count,
is_verified=self.is_verified,
is_private=self.is_private,
joined_date=self.joined_date
)

def __dir__(self):
Expand All @@ -150,7 +156,8 @@ def __dir__(self):
"followers_count",
"following_count",
"is_verified",
"is_private"
"is_private",
"joined_date",
]

def __repr__(self):
Expand Down