Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

post does not work #6

Open
hanscees opened this issue Aug 20, 2013 · 3 comments
Open

post does not work #6

hanscees opened this issue Aug 20, 2013 · 3 comments

Comments

@hanscees
Copy link

Hi,

been trying to use the script to upload but to no avail.

is this right?

twitpic -m bomengids yUAOXeDFyw T7hDjQQ oauth_token=324319099-WiJyNkshqfgKahdcH0IBSCTVhYOVxzXxfBvsVyVd&oauth_token_secret=gSmkBDUAHKzY=%s bb7c3defd60 /root/pics/1.jpg

I have tried
oauth_token=3243yVd&oauth_token_secret=gSmzY
oauth_token=3243yVd&oauth_token_secret=gSmzY=%s
oauth_token=3243yVd=%20&oauth_token_secret=gSmzY=%s
oauth_token=3243yVd=%20&oauth_token_secret=gSmzY=%s
oauth_token=3243yVd&oauth_token_secret=gSmzY=%s

all respons I get is:
HTTP/1.1 401 Unauthorized
Server: nginx
Date: Tue, 20 Aug 2013 20:40:23 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: close
X-Powered-By: PHP/5.3.5-1ubuntu7.2
5e
{"errors":[{"code":401,"message":"Could not authenticate you (header rejected by twitter)."}]}
0

I am sure my twitter secrets etc are right because they work using this perl script:
http://hanscees-howto.blogspot.nl/2013/08/hacking-twitter-send-tweets-with-simple.html

@hanscees
Copy link
Author

it would be nice for people using your code if you would include a standard script that actually has been verified by you to work.
This way non-coders can know if there is actually a bug. And you won't have to be bugged with code questions:-)

@hanscees
Copy link
Author

I also verified now that posting to twitpic works from a python script, but using twitpic commandline does not work.

The working code is (using python 2.7):

#################################
#!/usr/bin/python
import twitpic

twitpic = twitpic.TwitPicOAuthClient(
consumer_key = 'yU..........AOFyw',
consumer_secret = 'T7hxxJMTjQQ',
access_token = 'oauth_token=3299-WiJV...........yVd&oauth_token_secret=gS........mkDUAHKzY',
service_key = 'bb7c36d5cefd60'
)

response = twitpic.create('upload', {
'media': '/root/pics/1.jpg',
'message': 'test pic posted with python'
})

print(response['url'])
#################

It would be nice by the way if you could publish a script that also directly posts a tweet on twitter with a text and the resulting twitpic url

@macmichael01
Copy link
Owner

It would be nice by the way if you could publish a script that also directly posts a tweet on twitter with a text and the resulting twitpic url

The goal of this library interact strictly with twitpic's API. If you need to publish this to your twitter feed, the twitter library that you used to get your access token will also have a method to publish to your feed.

As for the commandline tool, I'd have to take a look, though my time is limited at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants