Comments (5)
Thank you very much Gmanicus, we should add these to the documentation.
from py3-pinterest.
Yw. Created PR #43
from py3-pinterest.
Good suggestion. The examples should be updated too.
The create board actually returns the full response object
return self.post(url=CREATE_BOARD_RESOURCE, data=data)
Initially I had custom object that contained only the meaningful information from the responses, but it was hard to maintain
from py3-pinterest.
Turns out all your functions were set that way and no changes need to be made! Printing the response directly shows something like <Response 200>
. If you dig a little deeper by going myresponse.content
you get the actual HTML response, which can then be turned into a dict by using JSON.
Example:
import json
pin = upload_pin(board_id="778489554276995995",
image_path="test.png",
description="TESTING PIN FUNCTIONALITY WITH LINK",
title="Foobar Barfood",
section_id=None,
link="www.geekoverdrivestudio.com")
pin_response = json.loads(pin.content)
Some helpful notes on the response:
Everything is stored inside the "resource_response" key. You can use that and grab all sorts of data like so:
id = pin_response["resource_response"]["id"]
# When creating such a resource, and you want to see details for what it was created IN,
# you just have to go one further step and access the key for whatever it is: section, board, pinner, etc
board_id = pin_response["resource_response"]["board"]["id"]
# Section will return None/Null if the pin wasn't placed within a section
section_id = pin_response["resource_response"]["section"]["id"]
pinner_username = pin_response["resource_response"]["pinner"]["username"]
pinner_id = pin_response["resource_response"]["pinner"]["id"]
from py3-pinterest.
Another note upon further use of this method:
Section and Board IDs are one step further down the dict. It may be the same for Pins too.
id = response["resource_response"]["data"]["id"]
from py3-pinterest.
Related Issues (20)
- Can't post a new pin HOT 3
- Issue creating pins HOT 1
- 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
- 404 Client Error: Not Found for url: https://www.pinterest.com/resource/PinResource/create/ HOT 1
- There is no [win64] chromedriver "latest" for browser google-chrome "114.0.5735.248" in cache
- upload_pin() and pin() not working
- Fail to login due to language of web driver does not change HOT 2
- Error on login
- Still active/working? HOT 4
- Another Error on login HOT 3
- Downstream issue in extruct HOT 1
- Timeout value connect was <object object at 0x000001714FAC8660>, but it must be an int, float or None.
- get_user_pins not returning all pins even with batching
- HTTPError: 401 Client Error: Unauthorized for url: https://www.pinterest.com/upload-image/
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.