On: 2009/06/25 Viewed: 12377 times
Shorter URL for this page: http://ozh.in/m7

yourls-logoYOURLS (Your Own URL Shortener) is a URL shortener, like TinyURL, except it’s all GPL and you can run it on your own server, publicly or for your own use only. It was made by Lester Chan and myself. Learn more about YOURLS.

This plugin, YOURLS: WordPress to Twitter, is the bridge between YOURLS, Twitter and your blog: when you publish a post or a page, it will use your own YOURLS install, either hosted on the same webserver, or another server, to create a short URL for your post and send it to your Twitter account. The plugin also works with public popular services such as TinyURL, tr.im, is.gd or bit.ly.

Download

Download the plugin : yourls-wordpress-to-twitter.zip
Extract and upload to your blog, preserving directory structure.
Enjoy.

Features and configuration

I’m going to be lazy, aren’t screenshots worth a thousand words? Here are 3000 words.

Plugin configuration:
screenshot-1

Title little helper: count characters to help you keep under the tweetable 140 char limit:
screenshot-2

From the Write screen, you can (re)generate short URLs and (re)promote your (old, for example) posts:
screenshot-3

Template Tags for you theme

The plugin comes with two template tags:

wp_ozh_yourls_url()
Will echo a HTML link with short URL (will generate it on the fly if needed) for the current post.
Example output: <a href="http://ozh.in/j5" rel="nofollow alternate shorter" title="short URL">http://ozh.in/j5</a>
Suggested use: in the loop, in single.php, in page.php

wp_ozh_yourls_head_linkrel()
Will output a <link/> in <head> for the current post (see revcanonical.appspot.com and shorturl.appjet.net for more info)
Example output: <link rel="alternate short shorter shorturl" href="http://ozh.in/j5" />\n
Suggested use: in header.php, if is_single() or is_page()

wp_ozh_yourls_raw_url()
Will return (or echo if you pass true to it) the short URL, with no HTML tag or anything else. Just the raw URL.

Feedback

Yeah. Go ahead.

Related posts

Shorter URL

Want to share or tweet this page? Please use this short URL: http://ozh.in/m7

Metastuff

This page "YOURLS: WordPress To Twitter (a Short URL Plugin)" was posted on 25/06/2009 at 10:15 pm
Watch this discussion : Comments RSS 2.0.

160 Blablas

    Pages: [16] 15 14 13 12 11 10 9 8 7 61 » Show All

  1. 160
    Desde.boxes Spain »
    thought, on 18/Mar/10 at 4:31 am # :

    Hello again!

    I thank you for the good work. Really it’s fantastic.

    I still with same error, but now I looked for answers.

    I tried another hosting, another blog and the problem isn’t solved. Then I came here and I saw most pages of “Blablas”, and deactivate wordpress stats plugin. The issue continues.

    The short url is generated, so WP->YOURLS works. The communication WP->Twitter is where all fails.

    I looked for in twitter.php, and I found the pluggin only shows an error if the response to twitter contains something like “error” word. I’m not sure with this, I’m not programmer.

    So I went back to the plugin’s page, changed my password to another wrong, and I tried one more time to publish a post. And the plugin told me “Success! Post was promoted”. What does mean this?

    I want to solve my problem, but here is a idea for improve the plugin. Why does not the plugin show a “sucess!” if all was OK?

    Can anyone offers me a way to looking for a solution? Any words to search with google?

    Thanks in advance.

  2. 159
    Ozh France »
    replied, on 17/Mar/10 at 8:29 pm # :

    Doug Smith » as of now, it’s not possible. This said, in a future version I’ll add hooks into the plugin, and it would then be doable to do what you want with a simple companion plugin

  3. 158
    Doug Smith United States »
    commented, on 17/Mar/10 at 7:01 pm # :

    Thanks so much for your work on YOURLS and the WordPress plugin!

    I have a quick question. Is there a way I could force the WordPress plugin to generate short URLs in the form of http://domain.com/POST-ID? This would have the advantage of my post URLs still working with a simple .htaccess rule if I stopped using YOURLS for some reason in the future.

  4. 157
    Desde.boxes Spain »
    wrote, on 16/Mar/10 at 6:14 pm # :

    Hello Ozh.

    I have the same issue than Mark (#147). All things appears as OK, but plugin doesn’t publish on twitter.

    Plugin creates short url OK, doesn’t appear any error, but it doesn’t post on twitter. New url appears on yourls installation, so wordpress->yourls works OK. Of course, I check three times user and password, and all is Ok.

    I can’t see any errors in all logs I saw. Can you help us?

    Thanks in advance.

  5. 156
    Aryan Australia »
    replied, on 12/Mar/10 at 11:01 pm # :

    or you can send me a config.php file which suits my need

  6. 155
    Aryan Taiwan »
    replied, on 12/Mar/10 at 9:42 pm # :

    Can we have a private chat so i can explain you the whole think so we can sort my problem out ;)

  7. 154
    Ozh France »
    commented, on 12/Mar/10 at 8:17 pm # :

    Aryan » I think I am exactly understanding what you want. Private install (password protected admin) *but* public stats and public API. Please re-read my replies and YOURLS doc.

  8. 153
    Aryan Australia »
    wrote, on 12/Mar/10 at 11:19 am # :

    you are not getting me … i want that people can see stat and able to use my website shortening service with yourls plugin but on the other hand admin must be protected

  9. 152
    Ozh France »
    replied, on 11/Mar/10 at 9:49 pm # :

    Aryan » http://yourls.org/#Config see Optional settings

  10. 151
    Aryan Australia »
    replied, on 11/Mar/10 at 9:13 pm # :

    /** Private means protected with login/pass as defined below. Set to false for public usage. */
    define(‘YOURLS_PRIVATE’, false);

    Look at this ….

    if i set it to true no one can see stats of its shorten url…. and if it is false than anyone can access the admin panel
    or if i change the path of my admin folder

    my yourls to twitter plugin stops working

    Need Your help in this badly

Pages: [16] 15 14 13 12 11 10 9 8 7 61 » Show All

Leave a Reply

Comment Guidelines or Die

  • HTML: You can use these tags: <a href=""> <em> <i> <b> <strong> <blockquote>
  • Posting code: Post raw code (no <> &lt; etc) within appropriate tags : [php][/php], [css][/css], [html][/html], [js][/js], [sql][/sql], [xml][/xml], or generic [code][code]
  • Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar.
  • Spam: Various spam plugins on patrol. I'll put pins in a Voodoo doll if you spam me.
  • I will mark as Spam test comments, all comments with SEO names (ie "My Cool Online Shop" instead of "Joe") or containing forum-like signatures.

Close
E-mail It