Please email for details about Twitter Image Host 2
-
-
Hi! I'm Michael Tyson, and I run A Tasty Pixel from our home in the hills of Melbourne, Australia. I write on a variety of technology and software development topics. I've also recently returned from a 3.5-year journey around Europe in a motorhome.
I make Loopy, the live-looper for iOS, Audiobus, the app-to-app audio platform, and The Amazing Audio Engine, the iOS audio framework.
75 Comments
The callback URL that the plugin gives me causes an error when I try to use it. I used it when I created the Twitter app but I get a 404 when trying to authenticate it. Any thoughts?
Thanks.
Nevermind. I figured it out. I was using default permalinks. Changing this option fixed it.
Thanks for the great plugin!
Ah, you beat me to it =)
A few more things:
1 – I’m not using bit.ly but would like to tweet a short URL from my custom URL shortener. I’ve been using the URL Shortener plugin (http://www.fusedthought.com/downloads#url-shortener-wordpress-plugin) until now to make that easier. My previous solution for hosting my Twitter images was able to get my short URL but this seems to use my long one. Is there a way to tweet the short URL? (It’s in a custom field just like twitter-image-host-2-md5 is.)
2 – When I tweet a new pic can the content of my tweet be used as the subject and body text of the blog post?
3 – Do you know of any themes that have been designed with this plugin in mind?
Thanks again, Dave
There’s a way to make this work, if you like – if you have a look at lines 174-187 of twitter-image-host.php, that’s where the URL is generated, either with bit.ly, or by just using the ?p=## post URL. You can replace this with whatever you like – for example, replace line 186:
with:
Sure, but you’ll need to modify some code for that too. Take a look at line 157:
…and have a look at wp_insert_post.
Not that I know of!
I finally had a chance to work on number two on my list (in an above comment). Figured I’d start with one point: making the tweet as the title of my post. Unfortunately I couldn’t figure it out. I played with the line you mentioned in response to my previous comment as well as some other lines in that area of the code and an earlier line ($title = $_REQUEST[‘message’] ? $_REQUEST[‘message’] : $_FILES[‘media’][‘name’];). It appears that the tweet isn’t being captured or I’m missing where you’re pulling it in. Any pointers?
Thanks, Dave
As a matter of fact, I probably should’ve used wp_get_shortlink right from the start. I’ve updated the development version to do this, now – it’ll be in the next official version.
Hi Dave – are you using ‘friendly’ permalinks? (as in, not the ?p=## kind)? That’s kinda a prerequisite for using the plugin, as it uses virtual URLs.
If not, make sure this is in the .htaccess file in your webroot:
Any idea if tweetbot 2.0 (released today) still works with your awesome plugin?
Do you know why i get an Upload Failed “failed to upload data” message from tweetbot when trying to upload images.
this happens on both image host and image host 2
I’ve set the api to that given in the plugin settings and wonder if there is a folder that needs to be created with the right read/write permission in the wordpress directory?
cheers
Hmm, if it’s happening with both 1 and 2, then I have no idea, I’m afraid – they’re both pretty different. Are you sure you’ve set everything up properly? Can you tweet from WordPress?
Hi.
Your “Twitter Image Host 2” is just what I’ve been looking for! :D
However… I can’t get it to work. – I’ve got the latest version of WordPress and the latest version of Tweetbot – I registered a read/write application at dev.twitter.com – I entered the given OAuth Consumer Key and Secret in the plugin in WordPress – I entered the Twitter Image Host 2 API access point into “Custom image upload” in Tweetbot
But when I try to post a tweet with Tweetbot, with an image attached, Tweetbot shows a red popup saying: “Upload Failed Failed to upload data.”
What am I doing wrong? What do I not understand?
By the way… The API access point is: http://mydomain.com/tih2/upload?key=somecharacters Is this correct? Technically, there is no subdomain tih2. Or is this arranged by the plugin…?
Hi Beun,
It sounds to me like you’ve configured it properly! One question: Do you have ‘pretty’ permalinks enabled? (That is, not the ?p=## kind).
Also, can you tweet from WordPress (from the Twitter Images section within Posts)?
I use custom permalinks: /%year%-%monthnum%-%day%/%postname%/
Tweeting from the Twitter Images Section within Posts: I can select an image alright, but I cannot enter text to accompany the image. There is a link that says I have to login to twitter first. Clicking that link gives this error message:
Fatal error: Cannot redeclare class OAuthException in /long-path/public_html/blog/wp-content/plugins/twitter-image-host-2/lib/OAuth.php on line 8
Aaaahh! There must be another plugin somewhere that already includes OAuth. Give me a moment, I’ll make it only include OAuth conditionally.
Okay, wait about half an hour, then grab the development version – when it’s updated, it should be version 2.0.1 (if it’s not, wait a bit longer – the server can take a little while to update).
Let me know if that works and I’ll release it.
Thanks!! :D
I’ll check and let you know a.s.a.p.
The version I downloaded just now does not seem to be 2.0.1. Or if it is, the changes you made to the code do not seem to have helped :o
Any suggestion on what to do?
Yep, it’s definitely 2.0.1, I just tried then.
I took the files from the ZIP-file, and uploaded them to my server, overwriting the files (with the same name) that were already there.
I get the same error message :o
Okay – and you sure you downloaded the right version? If it’s not saying 2.0.1 then that’s not the right one.
Where exactly should I look for the version number? A specific line in a specific file? Or somewhere in WordPress?
You’ll find it on the plugins page, or you can also find it in the plugin’s ‘php’ file, too.
Yes. Line six in twitter-image-host.php “Version: 2.0.1″
So it would seem I’ve got the right version :)
(Please delete the wrong comment of mine below this one)
(Thanks for deleting the wrongly placed message)
For what it’s worth… I was thinking the error message might have something to do with one of the other plugins I have in WordPress.
So just for this test, instead of wrecking the live site for a test, I did a fresh install of WordPress in a new location, and only added your plugin.
In this new installation, I get the same “……/lib/OAuth.php on line 8” error message when trying to login to Twitter via the “Twitter Images” section within Posts.
The message I get in Tweetbot however, is new. “Error uploading media Not found”
Does this help?
Alright… Got it working now. That is… I can tweet a picture from Tweetbot. (I Sent a message to Tweetbot support, by the way, about a blank space that wouldn’t go away in the image API settings.)
However… I cannot post a picture from the Twitter Images Section within Posts in WordPress. There’s a link there that says “Log in to Twitter to enable this feature.”
Clicking the link gives this error message: Fatal error: Class ‘OAuthSignatureMethod_HMAC_SHA1’ not found in /long-path/twitter/wp-content/plugins/twitter-image-host-2/lib/twitteroauth.php on line 62
I also use Yourls. Could it be that Twitter Image Host 2 is colliding with Yourls in some way?
Hmm, yes, we definitely have a namespace collision. I’ve just uploaded a development version that has prefixed all the OAuth libraries to try to avoid this. Wait an hour or so, then grab it (it should be reported as version 2.0.2) and let me know how you go.
The error message is gone now :) Thanks! If I click on the link “Log in to Twitter to enable this feature.” I now get the “Authorize [twitter dev app name] to use your account?”, so that’s good!
Upon clicking the “Sign In” button on the “Authorize [twitter dev app name] to use your account?”-page, I am redirected to a twitter page that says “Redirecting you back to the application. This may take a few moments.” Seems to work like it should…
But seconds later, I am redirected to my WordPress blog, looking at the index page, with in the URL bar the following address: http://myrandomwordpressblog.com/twitter/?oauth_token=the-token&oauth_verifier=the-verifier“
Heading back to the Twitter Images Section within Posts, I am not logged in.
Sounds like you’ve just not configured the app registration properly with Twitter – it should be going to /tih2, not /twitter. If in doubt, delete the Twitter app registration details from the plugin’s settings, save, then you’ll see the help come up again.
To test this, I manually added /tih2 to the long oauth-address in the URL bar in the browser, so the url reads: http://address/twitter/tih2/?oauth_token=the-token&oauth_verifier=the-verifier“ This immediately logs me in, so that works :)
I edited the callback URL at dev.twitter.com and added /tih2 to the callback URL. It works now.
Thanks for a great plugin!
One last question though… There is no physical directory or folder named tih2. Is it possible to, in a sentence or two, explain how this works? Does the plugin create like a “virtual” folder or directory?
Thanks again!
Glad to hear it!
http://en.wikipedia.org/wiki/Rewrite_engine =)
Got it. Thanks.
I realised I had tweetpress installed which must clash. Have removed this and can now tweet from within wordpress.
I will get a post created with a wordpress short url which is tweeted.
Tweetbot however using the api endpoint will not give the “error uploading media” “not found” error.
I have created a twitter-image-host and and tih2 directory in the uploads folder.
Hope this helps!
ignore, sorted my typo error in api endpoint.
copied a leading space before the http!
doh!
Hello, I was going to comment and report the trouble I was having, but it seems as though the dev version you released few days ago cured my bugs. So I thought I would take the time and thank you for this plugin.
I would like to point out also that, you can use wordpress.com’s FREE Jetpack plugin to use the WP.me shortlink. It works like a charm with your plugin and to be honest, a bit more user friendly than setting up bit.ly account =D
Thanks again!
Glad to hear it’s sorted! I’ve just released the dev version as 2.0.1.
That’s cool – does that mean you just needed to install Jetpack, or did you need to make some adjustments to the plugin?
your plugin is great :) I’ve integrated it with YOURLS and it is working fantastic… all but 1 issue…
it will not work with multibyte (ie: japanese) characters. I don’t know why. I’m using tweetbot as a client, and it works fine for posting on twitter.
I enter japanese text > 日本 <- use for your testing purposes and attach a photo, click tweet.
only the japanese text is tweeted ( with URL ) but no photo :(
Hey, does “post->tweet image” work for you? I have YOURLS integrated in wordpress and tweeting images to my blog with tweetbot works, but I can’t tweet images from wordpress. The text field is not writable and following the link “sign in to twitter” leads to a registration code. But then? I know I can just create a new post and let YOURLS automatically tweet it. But why is “post->tweet image” not working?
I’m only doing this as a self hosted alternative from twitpic. So not doing wp->twitter. Only twitter w/ images -> wp and using yourls to shorten the uri
Hi Michael,
I’ve used version 1 of your plugin for a while with no problems. I thought I would give the latest version a go on my personal site.
I have it all set up and installed but I can’t tweet from Tweetbot, I get told that there is an error and the post has been saved in drafts.
When I go to post twitter image direct from the site, I can log in to twitter using the link, so the Oauth is ok. When I upload an image I get the tweet and the link but the image isn’t in the post, see > http://michaelrawlins.co.uk/2012/02/keep-cal/
my wp-content/uploads is currently set to 777
I’m using version 2.0.2
Any ideas?
Cheers
Mike
Hi Mike,
Hm… What version of WordPress are you using? Do you see any errors in your server’s error log?
Hi Michael,
No there doesn’t seem to be anything written to the error log when I tested it this morning. The last few entries are:
[Fri Feb 24 14:35:03 2012] [error] [client 87.194.142.55] PHP Warning: strtoupper() expects parameter 1 to be string, array given in /var/www/vhosts/michaelrawlins.co.uk/httpdocs/wp-content/plugins/twitter-image-host-2/lib/OAuth.php on line 373, referer: http://michaelrawlins.co.uk/wp-admin/edit.php?page=twitter_image_host_2_posts [Fri Feb 24 16:14:40 2012] [error] [client 87.194.142.55] WPTP: Current version: v0, referer: http://michaelrawlins.co.uk/wp-admin/update.php?action=install-plugin&plugin=tweet-images&_wpnonce=506937f0d6 [Fri Feb 24 16:14:40 2012] [error] [client 87.194.142.55] WPTP: Flushed rewrite rules, referer: http://michaelrawlins.co.uk/wp-admin/update.php?action=install-plugin&plugin=tweet-images&_wpnonce=506937f0d6
Very strange…
Sorry for the links in the last post!
The last two lines are
[Fri Feb 24 16:14:40 2012] [error] [client 87.194.142.55] WPTP: Done upgrade, referer: /wp-admin/update.php?action=install-plugin&plugin=tweet-images&_wpnonce=506937f0d6 [Sun Feb 26 08:20:15 2012] [warn] RSA server certificate CommonName (CN) `Parallels Panel' does NOT match server name!?
Hmm, very odd indeed. You’ve been tweeting in English, right, with normal latin characters? It shouldn’t make a difference, as WP should automatically clean it up to make it into a filename, but I ask just in case…
yes all in English nothing fancy.
Oh and in answer to the version question 3.3.1 running these plugins
http://michaelrawlins.co.uk/plugins/
Mike & S0ya: I think I’ve figured out the problem – would you wait for the WP servers to update, then grab the development version again and let me know if it works?
Sure!
what version number should I see when I install it?
Actually, the same version number – it’s ready to go now, though, I just checked.
OK
the latest version seems to have fixed it all :)
I also restarted my server, deleted the application in Twitter and created a new one.
Thanks for your support
Great!
With the new version is it still possible to:
create a page like this http://seemyfotos.co.uk/pictures/ like you could in version 1 force it to post to a certain post type, like image or a custom post type?
Probably really simple questions but I’m not a coder ;)
It is, but you’d need to do some coding to create a custom category page that displays as thumbnails
I’ll have a play with some code, only one way to learn ;)
How could I get the plugin to use a particular post type?
Again many thanks for your help :)
No problem =) Hm.. Do you mean category? That’s in the plugin’s settings.
No not categories, I’ve selected that in the settings so all is good there.
I’m using TwentyEleven as the main theme and I would like images that come in via twitter and your plugin to go in to the ‘Image’ post format if possible.
Or be able to use a child theme to style the twitter post like an image post format.
Oh, cool, I didn’t realise that was a thing – I’m a little out of date, I suspect =) I’m just looking into it.
OK – test out the development version for me once it’s refreshed; v2.1
:D
http://michaelrawlins.co.uk/2012/02/testing-testing-twitter-images/
nice work :)
Thanks again for your script. I have all up and running at http://foto.beun.net/twitter
I have a question about something related to “Twitter Image Host 2”. Maybe you can help me out.
Do you have any suggestion on how to create “a gallery page” in WordPress with the photos uploaded via “Twitter Image Host 2”, similar to how Twitpic does it? Like, with a bunch of clickable thumbnails on a page? ( Example: http://twitpic.com/photos/Beun#type=gallery )
I think that would be cool 8-)
Thanks :)
FYI/FWIW… Found this: http://wordpress.org/extend/plugins/get-post-list-with-thumbnails/ Makes it look like this: http://foto.beun.net/twitter/overzicht/
Thanks for the great plugin!
Could you add a note though about the need for switching Permalinks away from the Default?
Just wasted several hours on this:-/
It would seem there is something up with the posting of the images. This morning I tweeted a picture, and this is the content of the wordpress post:
The correct image, with the right size, is chosen in the “src” part (1000×750), but because of the added “width” and “height” tags, the size shown in the post is wrong. (584×438)
Those width and height tags, and the numbers used by it, do they come from “Twitter Image Host 2” somehow? Or is this some other setting in WordPress?
(Sorry for posting this twice, but I used the code tag, and the code was not shown. Posting again now without the code tag, slightly editing the code itself to make sure it’ll show.)
It would seem there is something up with the posting of the images. This morning I tweeted a picture, and this is the content of the wordpress post:
img width=”584″ height=”438″ src=”http://foto.beun.net/twitter/wp-content/uploads/2012/02/some-image-1000×750.jpg” class=”attachment-large” alt=”Image so and so”
The correct image, with the right size, is chosen in the “src” part (1000×750), but because of the added “width” and “height” tags, the size shown in the post is wrong. (584×438)
Those width and height tags, and the numbers used by it, do they come from “Twitter Image Host 2” somehow? Or is this some other setting in WordPress?
Hey Beun,
That’s WP actually – The plugin just hooks into WP’s built-in image stuff. I dunno why it’s doing that, though! You can set what size you want in Twitter Image Host settings, though.
That’s “Image Size to Display”, you’re talking about, right? That is set to “Large”. And in the image settings in WordPress “Large” is set at a maximum of 1000×1000. And this does work, since the image actually IS 1000×750. It’s just the addition of some nasty width and height tags that in the end wreck the post.
I guess I’ll have to find a way for WordPress to NOT add width and height tags.
Thanks.
Figured it out, I think…
I use the standard WordPress theme twentyeleven. If you choose the one column option of this theme though, you get a very narrow design. Widening the design can be accomplished by editing line 74 in style.css in this theme.
This widens the design, but not the column that displays the content (photographs). Widening this column can be accomplished by editing line 45 in functions.php in this theme. The number entered here, in line 45, is the number WordPress will use as width in the image tag.
Just thought I’d share the above in case someone else might run into the same problem.
Hi Michael,
First I want to congratulate you for this plugin, thank you so much for the hardwork. I also want to mention that I am using the wordpress theme you created.
I have a quick question about the plugin though…The plugin works perfectly fine with tweetbot however I could not find a way to post the image in a subdirectory. Let me explain… When I use tweetbot and upload an image to my website, it directly posts into wordpress as a blogpost. What I want to do is to post the image without actually posting into the website as a blog entry but rather to be able to share the link and show the image without effecting the actual posts. Is this possible ?
Thanks Deniz =)
You want Twitter Image Host 1 for that.
Hello Michael,
Thank you so much, v1 works like a charm for me. No intentions on presenting the images as a gallery at the moment ?
Cheers…
Deniz.
Hi Again,
Just wanted to let you know that I am using both V1 and V2 of your plugins and it is working great: See the example below:
The only thing I am trying to get working is that the ability of clicking the image and show the content like version 1 does:
See examples below:
V1: http://www.machine-unix.com/du0ng/ versus V2: https://www.machine-unix.com/2012/03/sweet-mocha-madness-is-the-name-of-this-scrumptious-drink/
In Twitter Image Host 2, I am unable to click the picture..
Thanks again for your great support and plugins.
Tried clicking the link to WordPress to download and it’s saying the plugin is offline.
Is this temporary or is there an issue with the plugin?
Neill W
I Just now moved my WP photo blog from http://foto.beun.net/twitter to http://foto.beun.net. Seemed the right thing to do, because I don’t use the photo blog just for Twitter anymore, but also for (for instance) ADN.
Everything seems to be working just fine, except for Twitter Image Host 2. The API Access Point has changed, of course. The address does not contain the directory /twitter anymore. I have chanced this accordingly in Tweetbot, but I get the message “Upload Failed Failed to upload data.”
Any idea on what might be causing this? What have I missed?
Help….
Fatal error: Cannot redeclare the_twitter_image_permalink() (previously declared in /home/content/17/8863117/html/wp-content/plugins/twitter-image-host/twitter-image-host.php:51) in /home/content/17/8863117/html/wp-content/themes/expression/twitter-image-host.php on line 53
I may have screwed with something I shouldn’t have…