Comments (4)
Never tested that, if you do to many requests from one ip the account will be locked for 24 hours.
You need to use proxies, as for the max limit of invites there is no official data
from py3-pinterest.
How would I even begin to write the command though?
from py3-pinterest.
You need two things before you can start inviting.
- Board data for the board you will invite people to.
- List of users you want to invite
The board can be obtained in the following way.
boards = []
board_batch = pinterest.boards()
while len(board_batch) > 0:
boards += board_batch
board_batch = pinterest.boards()
board = boards[0]
In this case I picked the first board but you can pick any you like.
Next we need a list of user id to invite.
You can do this in many ways, I would do it using the search method.
Due to recent changes in the pinterest api, you can't search directly for users, instead you have to search for pins or boards and from there extract owners and pinners.
Here is a example code for the pins case:
results = []
max_results = 100
search_batch = pinterest.search(scope='boards', query='food', page_size=50)
while len(search_batch) > 0 and len(results) < max_results:
results += search_batch
pinterest.search(scope='pins', query='food', page_size=50)
target_users = []
for s in results:
target_users.append(s['owner'])
Now in target users you have a list of size 'max_results' with users.
You can specify different query.
If you have other means of extracting user ids that is ok you just need python array with ids.
The final step is to invite the users which is straight forward:
for user in target_users:
pinterest.invite(board_id=board['id'], board_url=board['url'], user_id=user['id'])
I found problems with the documentation and examples.py related to this issue which I will update.
from py3-pinterest.
I committed a file with the full code
https://github.com/bstoilov/py3-pinterest/blob/master/mass_board_invites.py
from py3-pinterest.
Related Issues (20)
- requests.exceptions.HTTPError: 403 Client Error
- Proxy issues
- Make `PyQt5` an optional dependency HOT 1
- Video Pins Problem... Unable to post video pins HOT 3
- Question: where do we get the board ID?
- No matching distribution found for PyQt5-Qt5>=5.15.2 (from PyQt5->py3-pinterest)
- pin method add support for pin_note HOT 2
- 250 pin limit on boards HOT 1
- 401 Client Error: Unauthorized for url HOT 4
- Pinning a photo fails with complete HTML-Javascript output from pinterest.com
- Can't post a new pin HOT 3
- Issue creating pins HOT 1
- I can't upload a new pin to my board HOT 2
- how search by image in visual search ?
- WebDriver login error HOT 1
- HTTPError: 403 Client Error HOT 1
- Issues with login? Here's the fix. HOT 1
- Bad request for url - Can't create pins HOT 3
- On my i386 pc I can no longer use chromium because of sse3 or chrome
- get_board_sections only returns default 25 sections
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py3-pinterest.