November 6, 2007

Microblogging With urlTea - My Twitter Bookmarklet

Filed under: Blogging, Twitter, Tech — La Bestia @ 5:10 am
Tags: , , , , , , , , , ,
Yo mama's so ugly they pay her to put her clothes on in strip joints.

del.icio.usDigg itFacebookFurlGoogleYahoo MyWebLinkrollFarkBloggerma.gnoliaNetscapeSpurlStumbleUponNetvouzNewsvineRawSugarredditShadowsSimpyBlinklistBlogmarksMr WongRojoSmarkingStartaidSegnaloWistsGift Tagging

As you know I’m trying the whole Mini-Blog thing now as a way of microblogging my thoughts - mostly on links to pages/stories I come across. Using a Twitter account and a plug-in called Twitter Tools from Alex King, I can show my Mini Blog on the left side, and then all the mini-blog entries/tweets for the day (using GMT time, unfortunately) get posted into a daily blog entry the next day. It’s a real cool tool.

Using Twitter for microblogging has become popular especially because Twitter will take any link it finds in your tweet and HTMLize it. One problem that I came across, though, was the cumbersome way of getting links and context into the tweet - a lot of copying and pasting going on. Because of the 140 character limit, Twitter has some kind of feature where it uses TinyUrl to shorten the urls posted into the status, but I couldn’t find a bookmarklet that would include the page title and a selection of text. Reason being, probably, this isn’t a highly requested feature. So I tried writing my own.

I did it in a somewhat cumbersome way, by using a bookmarklet to get the page URL, title, and selected text and call a PHP form that uses JSON to connect to the urlTea url shortening service. It then autoposts the form to the Twitter status window ready to be updated. All of this in a pop-up window and, of course, assuming you’re already signed into Twitter. I let Twitter handle the character count and any additional editing - especially when the page title and selected text become too long. The page title, the urlTea shortened link, and any selected text are copied in that order separated by a space.

TwitIt

The bookmarklet is a simple link that contains javascript. You drag it to your link toolbar (or just bookmark it from the right-click menu) and click it whenever you want to microblog. (If you’re new to bookmarklets - they’re an awesome timesaver. Check out the other bookmarklets I use.) I’m sure this smacks of hackery and is rife with style infractions. I offer no appologies or warranties. Take it and make it yours if you like it. Or just use the bookmarklet here and let me know how it works.

Update (11/14/07): So after looking over a few pages, and the inexplicable problems I had with the JSON api, I’ve updated the script to use the regular API. Which I can switch to use TinyUrl if I need to. I suppose I could then have it use the twitter API but I want the intermediate editing step.

The PHP page is real simple and portable:

<?php
$url = $_GET[”url”];
$title = $_GET[”title”];
$text = $_GET[”text”];
// $urlt = file_get_contents(”http://tinyurl.com/api-create.php?url=” . $url);
$urlt = file_get_contents(”http://urltea.com/api/text/?url=” . $url);
?>

<html>
<head>
<title>myopiclunacy.com’s Twitter urlTea submitter</title>
</head>
<body>
<form name=twit id=twit method=”get” action=”http://twitter.com/home”>
<input type=”hidden” name=”status” value=”<?php echo $title; ?> <?php echo $urlt; ?> <?php echo $text; ?>”>
</form>
<script type=”text/javascript”>
status = document.forms[0].status;
status.value=unescape(status.value.replace(/\\’/g,”‘”));
document.forms[0].submit();
</script>
</body>

If you’re looking for something for the Blackberry - check out this article from Tao of Mac.

Blog This

Popularity: 31% [?]

Powered by WordPress

#777 $150000 $150k $5 bill 007 10.5 17 18 1 19 0 1968 1996 2018 3 technique 39th Step 530 530n 530s 531 531s 6+5 64 bit 65 700p 700wx 72 dolphins 756 770 80s music 83 9 11 911 950 A Little Help A2DP Aaron Boone Aaron Lennon Aaron Rogers Abby Wambach ABC abortion Abraham Nunez abu ghraib abuse of power AC Milan ACC Access access linux Access Linux Platform accident acer aspire one acl activation Adam Vinatieri addai addonics Adebayor Adobe Creative Suite Adrian Peterson adultery affair Afghanistan africa AfterEffects aircheck Airport Extreme Ajax al davis Al Gore al jazeera al qaida Al Sharpton al roker Alabama alan greenspan alaska alaska independence party Albert Belle Albert Pujols Alec Baldwin alex p keaton Alex Rodriguez Alex Sanchez Alexander Litvinenko Ali G Alisher Usmanov All Star Saturday Night Allen Iverson alley allison stokke Alonzo Mourning alp Amanda Cicchini amateur music Amazon amd64 america american gladiators Americana Vodka Americas Chickens Americone Dream Amy Acuff amy fisher amy poehler Amy Winehouse Ana Ivanovic Ancelotti anchor Andorra andre arshavin Andre Miller Andrea Jaeger Andrea Pirlo andrei arshavin Andretti Green Racing android Andy Murray Andy Petitte Andy Pettitte Andy Reid Anfield Angela Moyers Ann Coulter Anni Friesinger anorexia anthem anthrax apartheid apartment Apple Apple Cup Apple retail stores AppleTV apps argentina Aris Aris Salonika aristotle arizona cardinals Arkansas Arsenal Arsene Wenger arson Art Fern artificial grass artisticnude aryans asafa powell Asante Samuel Ashley Cole Ashley Todd Ashley Young Asif Mandvi ass assasin associated press asterisk Aston Villa Asus EEE asus eee box asus ep20 AT&T AT&T Athletics atlanta Atlanta Falcons attack strategy Attorney General Auburn Tigers audacity audio converter auminum aussie rules Australian Open austria autism automakers avp Avram Grant Axiotron ayers babe ruth babes baby baby bump baby jessica Baby Kanu baby name back Back To The Future backer backwards b bad broadcasting practices bad economy bad people bailout Ballot Box Bunny balls ballstate baltimore ravens band aids bandit Banjo Bowl bar Barcelona Barnsley Barrack Obama Barry Bonds baseball Baseball Furies baseballfuries bash Basil D Oliveira Basketball bath bathroom battery BCS beach volleyball bear stearns bear sterns beatles beauty pageant beavers Beavis Becky Hammon beer beer party beijing belgium belly bellybutton Ben & Jerry Benjamin Nicholas bernie mac Besiktas Best Buy best buy sucks Bethanie Mattek BeyondTV BHO biden Big 12 big 3 Big East Big Ten bikini Bill Belicheck Bill Belichick Bill Callahan bill clinton bill gates bill maher Bill Parcells Bill Walton billeo billy mays billy vera Birmingham birth birth certificate birthday cake bitter BK black america Black Folks black friday black governor Black History Black Liberation Theology black mamba black republican blackberry blackhistory blackwater blaggy blazer blazers blogger Blogging blogosphere blogs blonde blooper blowback bluetooth bluetooth sync Bob Barr Bob Bradley Bob Davie Bob Kraft bob saget Bobby Bowden Bobby Petrino Bojan Krkic bolivia bondage Bonnie Richardson boobs bookmarklet bookmarklets boom boots booty booty dance booty shake booyah bora milutinovic Borat Boro Boston Celtics Boston Marathon Boston Red Sox bounced message bowling bowties Boxing boycott bra Brad Childress Brad Friedel Brady Anderson Brady Leaf Brandon Lloyd Brandt Snedeker brawl brazil breast cancer Bret Boone Brett Favre Brian Barwick Brian McNamee brian posehn Brian Roberts Brian Urlacher brick bringing bringingsexyback bristol British Open British slang Britney Spears brits broadcast Brock Berlin broken leg brolly brother Bruce Arena brunette Brutus The Barber Beefcake Bryant Gumbel BSOD bubbles Buffalo Bills Bugs Bunny bullwinkle bums bundling bundy bounce Burger King Burka Busbys Babes butt Butthead buzz ballads byu Cable News Cable TV calcio Calvin Broadus Calvin Johnson cam Cam Cameron cameltoe Camille Pin Canada Canadian cancell candace parker captures car racing career records careless challenge Carl Everett Carl Heinrich Pfänder Carla Bruni Carlo Ancelotti Carlos Bocanegra carmelo anthony Carnac Carolina Panthers cartoon cartoons cash machines cat fight Cat Whitehill caught on tape cayman cb cbs CBS4 CDMA celebs cell phone Cell Phones celtics center central park centro cesc Cesc Fabergas Cesc Fabregas CFL Chad Johnson Chad Pennington champagne Champions change Charles Barkley charlie brown Charlie Weiss chase bank chat cheap gas cheap pc cheap seats cheaters cheating cheerleaders Chelsea cheney Cherundolo chicago Chicago Bears Chickipedia children china chinese astronauts Chivas choke Chris Berman Chris Johnson chris matthews chris mcallister Chris Mortensen Chris Webber Christiano Ronaldo Christina Applegate christmas chrome chrris henry Chrysler Chuck Norris cia Cincinnati Bengals citizens band city of endless frowns class warfare classless Clay Hensley cleanup cleavage Cleo Lemon Cleveland clint dempsey clinton cloris leachman clothes cnn cnn international Coach K cobra cobra kai cocaine dealer code coeds coker colin powell college colts Comcast sucks comedian comedy Comedy Central comedy central roast Coming Home To Roost comments field commercial commercial banks commercials communist compusa Conan OBrien concussion condaleeza rice congress consecutive games Conservative Viewpoint Conservatives conspiracy theory constantly down constitution consumerist continent contract concessions convention converting video cookie monster cookies cooking Coolio corker cornholio corset costumes Countdown couple court cover up creative mp3 Creative Zen Credit credit crisis Credit Report Cricket cristiano ronaldo Croatia Croatian striker crowd noise cruise crying crystal bustos crystl bustos Cuauhtemoc Blanco cuban cups pdf curlftpfs curling Curt Schilling Curtis Davies Curtis Davis cut and paste Cycling Daily Express dailykos dailymotion Daisuke Matsuzaka Dallas Cowboys Damarcus Beasley Damian Moss Damien Wilkins Damon Huard Dan Marino Dan Marino Foundation dance song dancing Dancing With The Stars Danica Patrick Dante Bichette daphne daredevil Darfur Darrell Bevell Darren Holmes Darryl Kile data plan Daunte Culpepper David Beckham David Bell David Bentley david blaine david carr David Dein david frum David Hasselhoff David James David Letterman David Patterson David Segui daylight savings time Daytona 500 DC United deals DeAngelo Williams death of journalism debate debcled debunking defamation defense Deion Sanders dell dell 530n dell dude dell mini 9 demint democracy democrats democrats are surrender monkeys Denilson Dennis Franchione dennis rodman denver depression derby county derivatives Derrick Brooks derrick coleman destruction terror and mayhem detroit Detroit Lions Dhani Jones Dice K dick advocaat dick quest diego Difference Maker dimensioon 2400 Dimitar Berbatov DirecTV dirty politics disco Dish Network disney dissidents distracting from the issues divisiveness divorce dixon DLL dnc docstoc Dodge Dodi Al Fayed dolfans dolphins domestic football Dominique Wilkens Don Shula Donald Trump donation Donovan McNabb doping Dora The Explorer dorsag dortmund double masectomy double murder doug christie downblouse downloading video dozens dr phil dream team dreamweaver dress dressage drilling droopy drug dealers drumline drunk Dubai dude youre getting a dell DUI Duke Blue Devils Duke mascot Duke upset dumb criminal dumb teacher dun dunk c