Geeking out with twitter and flickr stuff

Geeking out with twitter and flickr stuff

Recently I found a php script by Chris Morrel which allows you to post photos to flickr (and get the correct flic.kr short url back) from Tweetie 2. I tweaked it a little to get used hashtags as flickr-tags and to have them removed from the title (the script uses the message as the title).

Right after:

    $tags = FLICKR_TAGS;
    if (TAG_WITH_HANDLE) {
        $tags .= ' @' . $_POST['username'];
    }

I added:

    preg_match_all('/#(\w+)/', $title, $matches);
    foreach ($matches[1] as &$tag) {
        $tags .= ' ' . $tag;
    }
    $title = preg_replace("/#\w+/i", '', $title);

It worked as I wanted, so yay!

Share on LinkedInShare on TumblrSubmit to StumbleUponSave on DeliciousDigg ThisSubmit to redditShare via email

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>