Skip to content

Commit 392d148

Browse files
authored
Merge branch 'master' into minor_fixes
2 parents 939cd60 + 74abaa8 commit 392d148

File tree

9 files changed

+60
-39
lines changed

9 files changed

+60
-39
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ _The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66

77

88
## [0.6.15] - UNRELEASED
9+
### Added
10+
11+
- Added `verified_only` argument to `get_followers` to return only verified users
12+
- `mandatory_bio_keywords` control before evaluating for mandatory
913

10-
## [0.6.14] - 2021-03-05
14+
## [0.6.14] - UNRELEASED
1115

1216
### Added
1317

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Implemented in Python using the Selenium module.<p>
3939

4040
<br />
4141

42-
**Learn Automation from Scratch: [The School of Automation](https://www.school-of-automation.com)**
42+
**Learn Automation from Scratch: [The School of Automation](https://www.school-of-automation.com)**
43+
**Learn the Skills to build your own InstaPy: [Automating Social Media Interactions](https://www.school-of-automation.com/learn/p/automating-social-media-interactions)**.
4344

4445
[<img src="https://static1.squarespace.com/static/5f71907917b093635185fc3e/t/5f9d03cec73af0034b6ffa3a/1604126514869/?format=1500w" width="250"/>](https://www.school-of-automation.com)
4546

docs/home.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ slug: /
4444

4545
<br />
4646

47-
**Learn Automation from Scratch: [The School of Automation](https://www.school-of-automation.com)**
47+
**Learn Automation from Scratch: [The School of Automation](https://www.school-of-automation.com)**
48+
**Learn the Skills to build your own InstaPy: [Automating Social Media Interactions](https://www.school-of-automation.com/learn/p/automating-social-media-interactions)**.
4849

4950
<a href="https://www.school-of-automation.com"><img src="https://static1.squarespace.com/static/5f71907917b093635185fc3e/t/5f9d03cec73af0034b6ffa3a/1604126514869/?format=1500w" width="250"/></a>
5051

docs/relationship-tools.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ _If the data is requested at the range **else than** `"full"`, it will write **t
4545
+ `6874` means the **count** of the usernames retrieved.
4646
+ `json` is the **filetype** and the data is stored as a `list` in it.
4747

48+
`verified_only`:
49+
Gives the _option_ to only return followers with a Verified status.
50+
* `verified_only=True`:
51+
+ Only returns followers that contain `is_verified` key
52+
* `verified_only=False`:
53+
+ Default option, Returns all followers for user
54+
4855

4956
There are **several** `use cases` of this tool for **various purposes**.
5057
_E.g._, inside your **quickstart** script, you can **do** _something like this_:

docusaurus/package-lock.json

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docusaurus/yarn.lock

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,10 +2369,10 @@ bluebird@^3.5.5, bluebird@^3.7.1:
23692369
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
23702370
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==
23712371

2372-
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.4.0:
2373-
version "4.11.9"
2374-
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828"
2375-
integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==
2372+
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9:
2373+
version "4.12.0"
2374+
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88"
2375+
integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==
23762376

23772377
bn.js@^5.1.1:
23782378
version "5.1.3"
@@ -2457,7 +2457,7 @@ braces@^3.0.1, braces@~3.0.2:
24572457
dependencies:
24582458
fill-range "^7.0.1"
24592459

2460-
brorand@^1.0.1:
2460+
brorand@^1.0.1, brorand@^1.1.0:
24612461
version "1.1.0"
24622462
resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f"
24632463
integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=
@@ -3884,17 +3884,17 @@ electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.571:
38843884
integrity sha512-uSEI0XZ//5ic+0NdOqlxp0liCD44ck20OAGyLMSymIWTEAtHKVJi6JM18acOnRgUgX7Q65QqnI+sNncNvIy8ew==
38853885

38863886
elliptic@^6.5.3:
3887-
version "6.5.3"
3888-
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6"
3889-
integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==
3887+
version "6.5.4"
3888+
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb"
3889+
integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==
38903890
dependencies:
3891-
bn.js "^4.4.0"
3892-
brorand "^1.0.1"
3891+
bn.js "^4.11.9"
3892+
brorand "^1.1.0"
38933893
hash.js "^1.0.0"
3894-
hmac-drbg "^1.0.0"
3895-
inherits "^2.0.1"
3896-
minimalistic-assert "^1.0.0"
3897-
minimalistic-crypto-utils "^1.0.0"
3894+
hmac-drbg "^1.0.1"
3895+
inherits "^2.0.4"
3896+
minimalistic-assert "^1.0.1"
3897+
minimalistic-crypto-utils "^1.0.1"
38983898

38993899
"emoji-regex@>=6.0.0 <=6.1.1":
39003900
version "6.1.1"
@@ -4953,7 +4953,7 @@ history@^4.9.0:
49534953
tiny-warning "^1.0.0"
49544954
value-equal "^1.0.1"
49554955

4956-
hmac-drbg@^1.0.0:
4956+
hmac-drbg@^1.0.1:
49574957
version "1.0.1"
49584958
resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
49594959
integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=
@@ -6421,7 +6421,7 @@ minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1:
64216421
resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7"
64226422
integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==
64236423

6424-
minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
6424+
minimalistic-crypto-utils@^1.0.1:
64256425
version "1.0.1"
64266426
resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
64276427
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=
@@ -7884,9 +7884,9 @@ prism-react-renderer@^1.1.0:
78847884
integrity sha512-MgMhSdHuHymNRqD6KM3eGS0PNqgK9q4QF5P0yoQQvpB6jNjeSAi3jcSAz0Sua/t9fa4xDOMar9HJbLa08gl9ug==
78857885

78867886
prismjs@^1.20.0:
7887-
version "1.21.0"
7888-
resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.21.0.tgz#36c086ec36b45319ec4218ee164c110f9fc015a3"
7889-
integrity sha512-uGdSIu1nk3kej2iZsLyDoJ7e9bnPzIgY0naW/HdknGj61zScaprVEVGHrPoXqI+M9sP0NDnTK2jpkvmldpuqDw==
7887+
version "1.23.0"
7888+
resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.23.0.tgz#d3b3967f7d72440690497652a9d40ff046067f33"
7889+
integrity sha512-c29LVsqOaLbBHuIbsTxaKENh1N2EQBOHaWv7gkHN4dgRbxSREqDnDbtFJYdpPauS4YCplMSNCABQ6Eeor69bAA==
78907890
optionalDependencies:
78917891
clipboard "^2.0.0"
78927892

instapy/instapy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4495,6 +4495,7 @@ def grab_followers(
44954495
amount: int = None,
44964496
live_match: bool = False,
44974497
store_locally: bool = True,
4498+
verified_only: bool = False,
44984499
):
44994500
"""
45004501
Gets and returns `followers` information of given user
@@ -4535,6 +4536,7 @@ def grab_followers(
45354536
store_locally,
45364537
self.logger,
45374538
self.logfolder,
4539+
verified_only,
45384540
)
45394541
return grabbed_followers
45404542

instapy/relationship_tools.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def get_followers(
3030
store_locally,
3131
logger,
3232
logfolder,
33+
verified_only=False,
3334
):
3435
""" Get entire list of followers using graphql queries. """
3536

@@ -189,7 +190,12 @@ def get_followers(
189190
page_info = data["user"]["edge_followed_by"]["page_info"]
190191
edges = data["user"]["edge_followed_by"]["edges"]
191192
for user in edges:
192-
all_followers.append(user["node"]["username"])
193+
# If verified_only is True, determine if user is verified before adding to all_followers
194+
if verified_only:
195+
if user["node"]["is_verified"]:
196+
all_followers.append(user["node"]["username"])
197+
else:
198+
all_followers.append(user["node"]["username"])
193199

194200
grabbed = len(set(all_followers))
195201

instapy/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ def validate_username(
461461
),
462462
)
463463
# the mandatory keywords applies to the username as well as the bio text
464-
if not evaluate_mandatory_words(
464+
if mandatory_bio_keywords and not evaluate_mandatory_words(
465465
username + " " + profile_bio, mandatory_bio_keywords
466466
):
467467
return False, "Mandatory bio keywords not found"

0 commit comments

Comments
 (0)