Blog

Twitter Image Host 2

Please email for details about Twitter Image Host 2

Tagged , , . Bookmark the permalink. Both comments and trackbacks are currently closed.

75 Comments

  1. Posted February 6, 2012 at 2:48 pm | Permalink

    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.

    • Posted February 6, 2012 at 2:54 pm | Permalink

      Nevermind. I figured it out. I was using default permalinks. Changing this option fixed it.

      Thanks for the great plugin!

      • Posted February 6, 2012 at 2:57 pm | Permalink

        Ah, you beat me to it =)

        • Posted February 6, 2012 at 3:19 pm | Permalink

          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

        • Posted February 6, 2012 at 4:47 pm | Permalink
          1. 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:

              $url = trailingslashit(get_option('siteurl')).'?p='.$post_id;

            with:

              $url = wp_get_shortlink($post_id);
            
          2. Sure, but you’ll need to modify some code for that too. Take a look at line 157:

                $post = array('ID' => $post_id, 'post_content' => $content, 'post_title' => $title, 'post_status' => 'publish');
            

            …and have a look at wp_insert_post.

          3. Not that I know of!

          • Posted February 29, 2012 at 9:20 pm | Permalink

            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

        • Posted February 6, 2012 at 4:51 pm | Permalink

          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.

    • Posted February 6, 2012 at 2:54 pm | Permalink

      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:

       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteRule ^index.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
      

  2. Evan
    Posted February 8, 2012 at 10:03 pm | Permalink

    Any idea if tweetbot 2.0 (released today) still works with your awesome plugin?

  3. funktakula
    Posted February 9, 2012 at 6:52 pm | Permalink

    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

    • Posted February 10, 2012 at 11:49 am | Permalink

      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?

  4. Beun
    Posted February 10, 2012 at 1:48 pm | Permalink

    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…?

    • Posted February 10, 2012 at 1:50 pm | Permalink

      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)?

      • Beun
        Posted February 10, 2012 at 1:55 pm | Permalink

        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

        • Posted February 10, 2012 at 1:56 pm | Permalink

          Aaaahh! There must be another plugin somewhere that already includes OAuth. Give me a moment, I’ll make it only include OAuth conditionally.

        • Posted February 10, 2012 at 2:02 pm | Permalink

          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.

          • Beun
            Posted February 10, 2012 at 2:04 pm | Permalink

            Thanks!! :D

            I’ll check and let you know a.s.a.p.

          • Beun
            Posted February 10, 2012 at 6:51 pm | Permalink

            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?

          • Posted February 10, 2012 at 6:55 pm | Permalink

            Yep, it’s definitely 2.0.1, I just tried then.

          • Beun
            Posted February 10, 2012 at 7:27 pm | Permalink

            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

          • Posted February 10, 2012 at 7:43 pm | Permalink

            Okay – and you sure you downloaded the right version? If it’s not saying 2.0.1 then that’s not the right one.

          • Beun
            Posted February 10, 2012 at 7:58 pm | Permalink

            Where exactly should I look for the version number? A specific line in a specific file? Or somewhere in WordPress?

          • Posted February 10, 2012 at 8:00 pm | Permalink

            You’ll find it on the plugins page, or you can also find it in the plugin’s ‘php’ file, too.

          • Beun
            Posted February 10, 2012 at 8:05 pm | Permalink

            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)

          • Beun
            Posted February 10, 2012 at 8:48 pm | Permalink

            (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?

    • Beun
      Posted February 20, 2012 at 4:15 pm | Permalink

      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?

      • Posted February 22, 2012 at 11:38 am | Permalink

        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.

        • Beun
          Posted February 22, 2012 at 12:52 pm | Permalink

          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.

        • Posted February 22, 2012 at 12:56 pm | Permalink

          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.

          • Beun
            Posted February 22, 2012 at 1:17 pm | Permalink

            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!

          • Posted February 22, 2012 at 1:20 pm | Permalink
          • Beun
            Posted February 22, 2012 at 1:35 pm | Permalink

            Got it. Thanks.

  5. Posted February 11, 2012 at 4:21 pm | Permalink

    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!

    • Posted February 11, 2012 at 4:25 pm | Permalink

      ignore, sorted my typo error in api endpoint.

      copied a leading space before the http!

      doh!

  6. Pete
    Posted February 14, 2012 at 11:28 pm | Permalink

    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!

    • Posted February 15, 2012 at 8:46 am | Permalink

      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?

  7. s0ya
    Posted February 19, 2012 at 9:39 am | Permalink

    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 :(

    • b3nj4m7n
      Posted February 20, 2012 at 3:22 pm | Permalink

      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?

      • S0ya
        Posted February 20, 2012 at 6:16 pm | Permalink

        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

  8. Posted February 24, 2012 at 3:02 pm | Permalink

    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

    • Posted February 25, 2012 at 8:16 pm | Permalink

      Hi Mike,

      Hm… What version of WordPress are you using? Do you see any errors in your server’s error log?

  9. Posted February 26, 2012 at 10:51 am | Permalink

    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…

  10. Posted February 26, 2012 at 10:53 am | Permalink

    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!?

    • Posted February 26, 2012 at 10:59 am | Permalink

      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…

  11. Posted February 26, 2012 at 11:14 am | Permalink

    Oh and in answer to the version question 3.3.1 running these plugins

    http://michaelrawlins.co.uk/plugins/

  12. Posted February 26, 2012 at 11:54 am | Permalink

    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?

    • Posted February 26, 2012 at 12:46 pm | Permalink

      Sure!

      what version number should I see when I install it?

      • Posted February 26, 2012 at 12:54 pm | Permalink

        Actually, the same version number – it’s ready to go now, though, I just checked.

        • Posted February 26, 2012 at 1:27 pm | Permalink

          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

        • Posted February 26, 2012 at 1:30 pm | Permalink

          Great!

          • Posted February 26, 2012 at 1:41 pm | Permalink

            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 ;)

          • Posted February 26, 2012 at 1:43 pm | Permalink

            It is, but you’d need to do some coding to create a custom category page that displays as thumbnails

  13. Posted February 26, 2012 at 2:26 pm | Permalink

    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 :)

    • Posted February 26, 2012 at 2:26 pm | Permalink

      No problem =) Hm.. Do you mean category? That’s in the plugin’s settings.

      • Posted February 26, 2012 at 2:36 pm | Permalink

        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.

      • Posted February 26, 2012 at 2:37 pm | Permalink

        Or be able to use a child theme to style the twitter post like an image post format.

      • Posted February 26, 2012 at 2:41 pm | Permalink

        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.

      • Posted February 26, 2012 at 3:01 pm | Permalink

        OK – test out the development version for me once it’s refreshed; v2.1

  14. Beun
    Posted February 26, 2012 at 11:13 pm | Permalink

    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 :)

  15. infinitary
    Posted February 27, 2012 at 10:45 pm | Permalink

    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:-/

  16. Beun
    Posted February 29, 2012 at 11:12 am | Permalink

    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?

  17. Beun
    Posted February 29, 2012 at 11:16 am | Permalink

    (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?

    • Posted February 29, 2012 at 11:30 am | Permalink

      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.

      • Beun
        Posted February 29, 2012 at 11:35 am | Permalink

        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.

        • Beun
          Posted February 29, 2012 at 8:43 pm | Permalink

          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.

  18. Posted March 15, 2012 at 6:46 am | Permalink

    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 ?

    • Posted March 15, 2012 at 9:26 am | Permalink

      Thanks Deniz =)

      You want Twitter Image Host 1 for that.

      • Posted March 16, 2012 at 4:27 am | Permalink

        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.

  19. Posted March 31, 2012 at 7:59 am | Permalink

    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.

  20. Posted May 3, 2012 at 10:22 am | Permalink

    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

  21. Beun
    Posted October 16, 2012 at 1:07 pm | Permalink

    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?

  22. Posted October 24, 2012 at 2:05 am | Permalink

    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…