Warning: SimpleXMLElement::addChild() [function.SimpleXMLElement-addChild]: unterminated entity reference S Clark Dr in /home/content/t/h/e/thenowhereman/html/blog/rss.php on line 43
Nowhere Manhttp://www.thenowhereman.com/blog/Nowhere Manhttp://creativecommons.org/licenses/by-nc-nd/2.5/chris@thenowhereman.comTue, 10 Nov 2009 22:37:44 -0700nowhereman77 posted a text message @ TempeTue, 10 Nov 2009 22:37:44 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3458http://www.thenowhereman.com/blog/viewPost.php?uid=3458#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3458brightkite@ <a href="http://brightkite.com/places/ee661536a22411dd9477c31559abceef">Tempe</a> : Just got my Google Wave invite! Today is just all about Google stuff for me.Google Voice with PHPTue, 10 Nov 2009 19:13:13 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3456http://www.thenowhereman.com/blog/viewPost.php?uid=3456#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3456google voicephptechhacksapi<img src="http://thenowhereman.com/images/smilies/cool.png" align="left" style="margin: 10px;" /> A while back, I wrote about <a href="http://thenowhereman.com/blog/viewPost.php?uid=3220">accessing Google Voice programmatically</a> in order to push SMS messages to my iPod. Well, it worked for a while, but never very well and eventually it stopped working altogether. Google may have changed something on their end or the Python tool I was using may have been to blame, or it could have been something else. There's no real way to know for sure. <p> I don't do Python, so rather than try and fix the tool, I decided to build my own using PHP, a language I'm much more comfortable with. There are a few existing code snippets out there written in PHP for doing various tasks with Google Voice, but most of them either didn't work or didn't do what I wanted to do. It came in fits and starts, but I finally have something that seems to work fairly well. So well in fact that I wanted to share it. It's pretty basic, but it gets the job done and it's fairly stable and reliable. Enjoy... <p> <div style="width: 550px; height: 600px; background: #000000; color: #00FF00; border: dotted 1px #000000; overflow: scroll;"> <pre style="font: monospace;"> /********************************************************************* ** ** com.thenowhereman.googlevoice ** A PHP class for interacting with Google Voice ** ** Copyright 2009, The Nowhere Man ** chris@thenowhereman.com, http://www.thenowhereman.com ** ** This file is distributed under the terms of the GPL ** http://www.gnu.org/licenses/gpl.txt ** ** Version History ** ------------------------------------------------------------------ ** 091109 v0.1 ** **********************************************************************/ class GoogleVoice { var $email; var $passwd; var $auth; var $rnr; function GoogleVoice( $email, $passwd ) { $this->email = $email; $this->passwd = $passwd; $ch = curl_init("https://www.google.com/accounts/ClientLogin"); curl_setopt($ch, CURLOPT_POSTFIELDS, "Email=" . $this->email . "&Passwd=" . $this->passwd . "&service=grandcentral"); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $raw = curl_exec($ch); curl_close($ch); if( preg_match('/Error=([A-z]+)/', $raw, $error) ) die( $error[1] ); if( preg_match('/Auth=([A-z0-9_-]+)/', $raw, $auth) ) $this->auth = $auth[1]; $ch = curl_init("https://www.google.com/voice/?auth=".$this->auth); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $raw = curl_exec($ch); curl_close($ch); preg_match( "/'_rnr_se'\: '([^']+)'/", $raw, $rnr); $this->rnr=$rnr[1]; } // // Place a call // $out is the number you want to call (10 digits, no dashes or parens) // $fwd is the number of the phone on your GV account you want the call to ring back to // function InitiateCall( $out, $fwd ) { $ch = curl_init("https://www.google.com/voice/call/connect/?auth=" . $this->auth ); curl_setopt($ch, CURLOPT_POSTFIELDS, "outgoingNumber=" . $out . "&forwardingNumber=" . $fwd . "&subscriberNumber=undefined" . "&remember=0" . "&_rnr_se=" . $this->rnr ); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $raw = curl_exec($ch); curl_close($ch); return $raw; } // // Send an SMS message // $ph is the recipient's 10 digit phone number // $msg is the text of your message // function SendSMS( $ph, $msg ) { $ch = curl_init("https://www.google.com/voice/sms/send/?auth=" . $this->auth ); curl_setopt($ch, CURLOPT_POSTFIELDS, "phoneNumber=" . $ph . "&text=" . urlencode( $msg ) . "&_rnr_se=" . $this->rnr ); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $raw = curl_exec($ch); curl_close($ch); return $raw; } function Inbox() { $ch = curl_init("https://www.google.com/voice/inbox/recent/inbox/?auth=" . $this->auth ); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $raw = curl_exec($ch); curl_close($ch); return $raw; } function Starred() { $ch = curl_init("https://www.google.com/voice/inbox/recent/starred/?auth=" . $this->auth ); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $raw = curl_exec($ch); curl_close($ch); return $raw; } function Placed() { $ch = curl_init("https://www.google.com/voice/inbox/recent/placed/?auth=" . $this->auth ); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $raw = curl_exec($ch); curl_close($ch); return $raw; } function Received() { $ch = curl_init("https://www.google.com/voice/inbox/recent/received/?auth=" . $this->auth ); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $raw = curl_exec($ch); curl_close($ch); return $raw; } function Missed() { $ch = curl_init("https://www.google.com/voice/inbox/recent/missed/?auth=" . $this->auth ); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $raw = curl_exec($ch); curl_close($ch); return $raw; } function Voicemail() { $ch = curl_init("https://www.google.com/voice/inbox/recent/voicemail/?auth=" . $this->auth ); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $raw = curl_exec($ch); curl_close($ch); return $raw; } function Recorded() { $ch = curl_init("https://www.google.com/voice/inbox/recent/recorded/?auth=" . $this->auth ); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $raw = curl_exec($ch); curl_close($ch); return $raw; } function SMS() { $ch = curl_init("https://www.google.com/voice/inbox/recent/sms/?auth=" . $this->auth ); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $raw = curl_exec($ch); curl_close($ch); return $raw; } function Trash() { $ch = curl_init("https://www.google.com/voice/inbox/recent/trash/?auth=" . $this->auth ); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $raw = curl_exec($ch); curl_close($ch); return $raw; } } </pre></div>nowhereman77 posted a text message @ Tempe, AZ 85282Tue, 10 Nov 2009 18:54:25 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3457http://www.thenowhereman.com/blog/viewPost.php?uid=3457#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3457brightkite@ <a href="http://brightkite.com/places/10dea0649f3311dda3d7003048c10834">Tempe, AZ 85282</a> : Google sent me $100 gift card to get me to try AdWords. Maybe I will give it a shot. OfficeMon, 09 Nov 2009 14:33:01 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3455http://www.thenowhereman.com/blog/viewPost.php?uid=3455#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3455flickr<p><a href="http://www.flickr.com/people/nowhereman/">nowhereman</a> posted a photo:</p> <p><a href="http://www.flickr.com/photos/nowhereman/4090938808/" title="Office"><img src="http://farm3.static.flickr.com/2660/4090938808_18de9cb6b4_m.jpg" width="240" height="180" alt="Office" /></a></p> <p>C is for cookie. That's good enough for me! - <a href="http://brightkite.com/objects/18d791429d8bfdc70a8d83a1f63c4948" rel="nofollow">from Brightkite</a></p>nowhereman77 posted a photo @ OfficeMon, 09 Nov 2009 14:32:03 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3454http://www.thenowhereman.com/blog/viewPost.php?uid=3454#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3454brightkite@ Office : <img src="http://s3.amazonaws.com/bk_store/18/d7/18d791429d8bfdc70a8d83a1f63c4948-feed.jpg" /><br />C is for cookie. That's good enough for me!nowhereman77 posted a text message @ Texas Motor SpeedwaySun, 08 Nov 2009 13:38:22 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3453http://www.thenowhereman.com/blog/viewPost.php?uid=3453#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3453brightkite@ <a href="http://brightkite.com/places/9331fa38edd5134c2772465bb3d413b8">Texas Motor Speedway</a> : Mark Martin may have just gotten the break he needs to win the cup this yearnowhereman77 posted a text message @ E Rio Salado Pkwy Sat, 07 Nov 2009 19:14:24 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3452http://www.thenowhereman.com/blog/viewPost.php?uid=3452#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3452brightkite@ <a href="http://brightkite.com/places/9c51831f4dd9faed91c4f63780327682">E Rio Salado Pkwy & S Clark Dr</a> : Another travel bug passed through my geocache this week. It came all the way from the UK http://bit.ly/1i9Cc3nowhereman77 posted a text message @ United States CapitolSat, 07 Nov 2009 18:14:34 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3451http://www.thenowhereman.com/blog/viewPost.php?uid=3451#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3451brightkite@ <a href="http://brightkite.com/places/6e413cdff37ed09a7b551811a3d8700a">United States Capitol</a> : Watching the healthcare debate on cspan. Amazing how much time these people waste. Butch Cassidy and the Sundance KidSat, 07 Nov 2009 08:00:14 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3450http://www.thenowhereman.com/blog/viewPost.php?uid=3450#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3450netflix<a href="http://www.netflix.com/Movie/Butch_Cassidy_and_the_Sundance_Kid/26308213?trkid=134852"><img src="http://cdn-0.nflximg.com/us/boxshots/small/26308213.jpg"/></a><br>Legendary outlaws Butch Cassidy (Paul Newman) and the Sundance Kid (Robert Redford) display their gifts for perfect comedic timing and charisma as they pull off heist after heist in this Academy Award-winning film from director George Roy Hill. To evade a relentless posse, the boys flee to Bolivia, thinking they'll find easier pickings there. But trouble finds the charming desperadoes wherever they go, prompting yet another run.nowhereman77 posted a text message @ TempeThu, 05 Nov 2009 19:17:39 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3449http://www.thenowhereman.com/blog/viewPost.php?uid=3449#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3449brightkite@ <a href="http://brightkite.com/places/ee661536a22411dd9477c31559abceef">Tempe</a> : Al Gore on Charlie Rose talking about his new book http://bit.ly/4ianMmAppleInsider - Apple co-founder Steve Jobs named Fortune 'CEO of the Decade'Thu, 05 Nov 2009 09:11:48 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3448http://www.thenowhereman.com/blog/viewPost.php?uid=3448#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3448linkCongrats, Steve!The GraduateWed, 04 Nov 2009 08:00:11 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3447http://www.thenowhereman.com/blog/viewPost.php?uid=3447#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3447netflix<a href="http://www.netflix.com/Movie/The_Graduate/555221"><img src="http://cdn-0.nflximg.com/us/boxshots/small/555221.jpg"/></a><br>Dustin Hoffman (in his first major film role) turns in a landmark performance as a na&#239;ve college graduate who is seduced by a middle-aged neighbor (Anne Bancroft) but ends up falling in love with her beautiful, young daughter (Katharine Ross). Mike Nichols won a Best Director Oscar for this 1960s classic, which boasts an immortal score from Simon and Garfunkel that includes the iconic "Mrs. Robinson."OfficeMon, 02 Nov 2009 15:05:02 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3445http://www.thenowhereman.com/blog/viewPost.php?uid=3445#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3445flickr<p><a href="http://www.flickr.com/people/nowhereman/">nowhereman</a> posted a photo:</p> <p><a href="http://www.flickr.com/photos/nowhereman/4069321109/" title="Office"><img src="http://farm3.static.flickr.com/2729/4069321109_a2cfd5ae09_m.jpg" width="240" height="180" alt="Office" /></a></p> <p>The LizardTech sales rep is in town and dropped in to say hi. He brought toys. - <a href="http://brightkite.com/objects/226aff280bb03fef1db5379694032ec7" rel="nofollow">from Brightkite</a></p>nowhereman77 posted a photo @ OfficeMon, 02 Nov 2009 15:04:48 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3446http://www.thenowhereman.com/blog/viewPost.php?uid=3446#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3446brightkite@ Office : <img src="http://s3.amazonaws.com/bk_store/22/6a/226aff280bb03fef1db5379694032ec7-feed.jpg" /><br />The LizardTech sales rep is in town and dropped in to say hi. He brought toys.nowhereman77 posted a text message @ OfficeMon, 02 Nov 2009 11:16:17 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3444http://www.thenowhereman.com/blog/viewPost.php?uid=3444#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3444brightkite@ Office : Now they're jackhammering right outside my office. Time for an early lunch. nowhereman77 posted a text message @ OfficeMon, 02 Nov 2009 08:44:35 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3443http://www.thenowhereman.com/blog/viewPost.php?uid=3443#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3443brightkite@ Office : Oh fun. Cox is here digging up our parking lot. Michael ClaytonSat, 31 Oct 2009 08:00:10 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3442http://www.thenowhereman.com/blog/viewPost.php?uid=3442#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3442netflix<a href="http://www.netflix.com/Movie/Michael_Clayton/70059995"><img src="http://cdn-0.nflximg.com/us/boxshots/small/70059995.jpg"/></a><br>Screenwriter Tony Gilroy delivers a finely tuned directorial debut with this dramatic thriller about burned-out corporate lawyer Michael Clayton (George Clooney), a man who's built his career on cleaning up other people's messes. When a guilt-ridden colleague (Tom Wilkinson) threatens the settlement of a multimillion-dollar case, Clayton faces his biggest challenge yet. Tilda Swinton nabbed an Oscar for her turn as a conflicted general counsel.nowhereman77 posted a text message @ OfficeFri, 30 Oct 2009 15:41:56 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3441http://www.thenowhereman.com/blog/viewPost.php?uid=3441#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3441brightkite@ Office : Just made our sales goal for the month Your Tax Dollars at WorkFri, 30 Oct 2009 12:21:26 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3440http://www.thenowhereman.com/blog/viewPost.php?uid=3440#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3440epageospatialgis<img src="http://thenowhereman.com/images/smilies/tounge.png" align="left" style="margin: 10px;" /> The EPA gave a me a good chuckle this morning. I requested a chunk of data from them that wasn't available for download on their website. This is their response... <p /> <div class="quote">the Envirofacts database is only available for online use. We do not provide copies of the Envirofacts database, or any component parts thereof, to users. </div> <p /> Just between you and me, that's completely false. <a href="http://www.epa.gov/enviro/geo_data.html">This page</a> on the EPA's website is dedicated exclusively to letting users download "component parts" of the Envirofacts database. It just doesn't include the part of the database I'm interested in. So I get to start jumping through hoops and file an official Freedom of Information Act request for data that I know someone could have just emailed me if they had wanted to make a bit of an effort.Tempe, AZ 85281Thu, 29 Oct 2009 08:30:02 -0700http://www.thenowhereman.com/blog/viewPost.php?uid=3438http://www.thenowhereman.com/blog/viewPost.php?uid=3438#commentshttp://www.thenowhereman.com/blog/viewPost.php?uid=3438flickr<p><a href="http://www.flickr.com/people/nowhereman/">nowhereman</a> posted a photo:</p> <p><a href="http://www.flickr.com/photos/nowhereman/4055976040/" title="Tempe, AZ 85281"><img src="http://farm4.static.flickr.com/3041/4055976040_5ee76bc27b_m.jpg" width="240" height="180" alt="Tempe, AZ 85281" /></a></p> <p>Tumble weed outside the office this morning. Growing up we made "snow men" out of them. - <a href="http://brightkite.com/objects/9f7cacc689e6489b45645a544c802174" rel="nofollow">from Brightkite</a></p>