Comments (13)
So the version is:
Version: 0.3.0
That is indeed the latest one.
One thing I noticed
user_ids=my_user_id
my_user_id is array right?
from py3-pinterest.
Glad to hear that it is now working :)
from py3-pinterest.
I get same response when using an already existing conversation to send message.
Code
from py3pin.Pinterest import Pinterest
pinterest = Pinterest(email=my_email, password=my_password, username=my_username, cred_root=my_cred_root)
conversations = pinterest.get_conversations()
first_conversation = conversations[0]
first_conversation_id = first_conversation['id']
print (first_conversation_id)
response = pinterest.send_message('hi there',first_conversation_id)
print (response)
Response:
5066715636181289166
<Response [400]>
Any help shall be much appreciated. :) Thank you.
from py3-pinterest.
I will look in to it, can you print the content of the response, response.content, there might be some clues there
from py3-pinterest.
So it says invalid HTTP method for resource method.
This is not the entire output of response.content. Sine it's very long and probably not of any use, I have trimmed the trailing output. But please let me know in case it makes it easier for you.
Thank you :)
"resource_response":{
"error":{
"status":"failure",
"http_status":400,
"code":12,
"message":"INVALID_HTTP_METHOD_FOR_RESOURCE_METHOD"
}
},
from py3-pinterest.
Just some additional information.
In the file Pinterest.py,
there is (at Line 48):
CONVERSATION_RESOURCE = 'https://www.pinterest.com/resource/ConversationsResource/get/
when I visit this URL in my browser, I get:
{ "resource_response": {
"status" : "success",
"code":0,
...
This above resource is used for get_conversations()
and from the response in browser we can see that it works perfectly fine.
Also in the same file at Line 49, there is:
CONVERSATION_RESOURCE_CREATE = 'https://www.pinterest.com/resource/ConversationsResource/create/'
when I visit this URL in my browser, I get:
{ "resource_response" : {
"error": {
"status" : "failure",
"http_status" : 400,
"code" : 12,
"message" : "INVALID_HTTP_METHOD_FOR_RESOURCE_METHOD"
}
},
...
This above resource is used for initiate_conversation()
and from the response in browser we can see that the resource does not work.
I get this same error when visiting the URL for resource SEND_MESSAGE = 'https://www.pinterest.com/resource/ConversationMessagesResource/create/'
(at Line 51 in Pinterest.py).
from py3-pinterest.
Thank you for being so proactive. 'https://www.pinterest.com/resource/ConversationMessagesResource/create/' is a POST requests and your browser makes GET requests in the url, so it is normal to get INVALID_HTTP_METHOD_FOR_RESOURCE_METHOD.
As for the issue I was not able to reproduce it.
Can you check the following things:
- You are able to send message to the user using the pinterest UI
- The user hasn't blocked you or anything like that
- You are using the latest code/build
from py3-pinterest.
https://github.com/bstoilov/py3-pinterest/blob/master/messages_example.py
The last line works just fine for me:
send_message(username='username', message='hi2')
it will initiate the conversation if there are no previous messages with this user
from py3-pinterest.
Thank you for the post/get information :)
Regarding the things that you mentioned:
- I am able to send messages to the user through the UI.
- The user hasn't blocked me.
- I am stuck here. Something wrong with my pip. So fixing that in the meanwhile. Is there any way on your mind to check for the version without using pip?
I used the file messages_example.py and the same error occurs if I print the response in the function. I tried this with two different users of Pinterest, just to be sure. Still not working :(
I am fixing my pip and after fixing, will find the version of py3-pinterest and will let you know.
from py3-pinterest.
You could try directly checking out the code.
You can even checkout this PR branch
to see if I have some how managed to fix the issue without realizing, but I highly doubt this.
from py3-pinterest.
So the version is:
Version: 0.3.0
from py3-pinterest.
You could try directly checking out the code.
Yup done that too but still no luck till now. I am gonna have to dig deeper.
You can even checkout this PR branch
I'll do that too and will let you know when I succeed.
Thank you for your time and help :)
Cheers.
from py3-pinterest.
my_user_id is array right?
Goodness me. I cannot believe this. I made the my_user_id
an array and appended the ID to it. It finally works.
I spent almost one entire day on this and look where the issue was.
Thank you Mr. Stoilov for the help. I am grateful to you. :)
Cheers and please continue with this marvellous project.
Just for future users:
When initiating conversation, user_ids
in the argument passed to function initiate_conversation(self, user_ids=None, message='hi')
should be an array/list.
from py3-pinterest.
Related Issues (20)
- 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
- 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.
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.