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

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 all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,10 @@ 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, user_id: "1019138658"}
{'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'}
```



## Contributing to twitter-scraper
To contribute to twitter-scraper, follow these steps:

Expand All @@ -135,9 +134,9 @@ Alternatively see the GitHub documentation on [creating a pull request](https://

Thanks to the following people who have contributed to this project:

* @kennethreitz (author)
* @bisguzar (maintainer)
* @lionking6792
* @kennethreitz (author)
* @ozanbayram
* @xeliot

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,8 +23,9 @@ class Profile:
- following_count
- is_verified
- is_private
- joined_date
- user_id
"""
"""

def __init__(self, username):
headers = {
Expand Down Expand Up @@ -66,6 +67,10 @@ 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
if not self.joined_date:
self.joined_date = None

self.birthday = html.find(".ProfileHeaderCard-birthdateText")[0].text
if self.birthday:
self.birthday = self.birthday.replace("Born ", "")
Expand Down Expand Up @@ -136,6 +141,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,
user_id=self.user_id
)

Expand All @@ -155,6 +161,7 @@ def __dir__(self):
"following_count",
"is_verified",
"is_private",
"joined_date",
"user_id"
]

Expand Down