Month: June 2010

Programmableweb’s API directory

Really, Really quick update. Last night the Frinly API was added to Programmableweb.com’s API directory. To me this is huge deal because I’m such a big fan of the site. The approval process took a about week or maybe it was two, and I have to admit there where times that I was seriously doubting if it would ever happen. Then last night at dinner, during one of my random email checks, BAM, the acceptance email! Yea that basically made my day, it was pretty Awesome.

Frinly API Screenshot

Frinly API Screenshot

A good Linux PHP Editor?

So I finally got my laptop to a point where I love working on it. It’s now what I would call
“The Ultimate Work Machine”.

Like most computers purchased from large retail chains Vista was pre-installed, along with a whole bunch of other crap ware. I’m not a big fan of Vista, I did like XP. But because of Vista I didn’t really enjoy working on this laptop at all. It quickly became a machine I kept around the TV so I could do quick searches between commercials. Or under the bed so I could get to it quickly if I remembered something before I went to sleep.  I had totally written this computer off.

Then one day while having lunch with a old colleague It dawned on me that most of the SEO tools that I use for analyzing web sites where all browser based (Firefox). Meaning I could basically run all of my favorite plugins while being in a Linux environment (I bet most of you all are like duh, I was too) . And for the applications that where not available in Linux, I was able to find great replacements. Digsby for example is a great IM client but does not have a Linux version yet, so there’s Kopete and Empathy which are great replacements.
FileZilla on the other hand did have a Linux version and I’m happy about that because this is one of my must have application, I use FileZilla a lot.
For opening documents and spreadsheets Open Office can be used to replace Microsoft Office. Open Office is incredible and I can’t believe it’s FREE and comes pre-installed with Linux.

The only thing that I’m missing right now is a good Linux based PHP editor/IDE. I started using PHP designer 7 before I made the switch and really like what it offered. But they don’t have a Linux version right now and I’m not sure if they ever plan to. So I’m currently bouncing between three different editors right now,  Komodo Edit, Geany, and gPHPedit. I’m leaning towards Komodo Edit but there’s this one little thing that I can’t get it to do. I’m sure it’s a lack of knowledge on my part versus the software’s functionality. So for now I figured I will continue testing these three until the end of next month. Hopefully by then I will be at a position to make a decision.

But for now, for the first time I’m enjoying my laptop. It’s the perfect work machine.

The applications and Firefox plugins I have running included:

  • OS – Linux Ubuntu 10.0.04
  • Apache, PHP, MySql, PHPMyAdmin
  • Editors – Komodo Edit, Geany, and gPHPedit
  • FTP Client – FileZilla
  • SSH Client – Putty
  • IM Client – Kopete
  • Browser – Firefox
    • ColorZilla
    • DT Whois
    • Echofon
    • Gmail Button
    • Live PageRank
    • Measureit
    • S3 Firefox Orginizer
    • Screengrab
    • Ubuntu Firefox Modification
    • HttpFox

Kopete

Make Twitter Updates with PHP and cURL

I’m sure I’ve mentioned sometime before that I’m a big fan of Twitter. I think Twitter has done a great job with their API, and the documentation for their API. They’ve made it fairly simple for developers to create Twitter based applications without jumping through a lot of hoops.

Well below is a bit of code I’ve used in the past to make status updates to Twitter. If your familiar with cURL then you’ll see that its pretty straight forward. The end result examines the HTTP code to determine if the status update was successful or failed you can comment this part out if you wish.

But before you go plowing away with the code I think it would be a good idea if you make yourself familiar with their documentation. They have a few rules that could save you some heartache down the road.

== Twitter Documentation ==
http://apiwiki.twitter.com/Twitter-API-Documentation

== PHP Code To Post Twitter Status Updates ==

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?PHP

/* Post Twitter Status Update using PHP & cURL */

function postToTwitter($username,$password,$message){
 
   $username = $username;
   $password = $password;
   $twitterHost = "http://twitter.com/statuses/update.xml";
   $yourStatus = $message;
   $curl;
   
   $curl = curl_init();
   curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2);
   curl_setopt($curl, CURLOPT_HEADER, false);
   curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
   curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
   curl_setopt($curl, CURLOPT_USERPWD, "$username:$password");
   curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
   curl_setopt($curl, CURLOPT_POSTFIELDS, "status=". urlencode(stripslashes(urldecode($yourStatus))));
   curl_setopt($curl, CURLOPT_URL, $twitterHost);
   
   $result = curl_exec($curl);
   $resultArray = curl_getinfo($curl);
   
   if ($resultArray['http_code'] == 200) {
   
   $twitterPostStatus = "Success";
   
   } else {
   
   $twitterPostStatus = "Failed";
   
   }
   curl_close($curl);
   
 return $twitterPostStatus;  
}

$username = 'username_here';
$password = 'password_here';
$message = "Working with the Twitter API";

$result = postToTwitter($username,$password,$message);

print_r($result);
?>

Fixed Broken Links

I just noticed I had some broken links on my PHP Scripts page. I repaired the links so the downloads should be back to normal.
I have to say I looked over the code that was used to make this scripts and a lot of it is old. I’m leaving it in place hoping that it can still in some way be helpful.
Later,
Joe

– – UPDATED —
I included two scripts that I had on the old site that somehow was forgotten when I made the move.

Twitter Oauth and Amazon A3

After about two weeks I’m back. Things took longer then what I expected but I did get a lot accomplished. I totally re-vamped my image hosting site, from a code perspective. Users are now required to have a twitter account to use Frinly. I’m using Twitter Oauth for log in authentication. I also added Amazon A3 service so now all of the images are hosted on Amazon’s servers. I’ve Built a Upload and Post and Post only API so that users can use 3rd party applications to post images. I’ve changed the way incoming email is answered and dumped the script and cron job that checked a designated pop3 account. And last, but not least I upgraded the Frinly WordPress Widget so now you don’t have to hack the code to configure it to work. Now configurations are made through the options interface.

I think I kicked some ass actually. There where a whole bunch of tutorials I had to read to get this done. Two weeks ago I had no idea how Amazons cloud storage worked. Now I’m scratching my head wondering why in the heck haven’t I been using this all along. It’s awesome!

I’m not 100% finished yet. I have a few more features that I would like to add but I’m going to hold off for a couple of weeks before I start on them. I really want to work on this other project I’ve been thinking about for sometime now. I plan to post updates when I can but to be honest I know how I am when It comes to programming. It consumes me.

Overall the best part of buckling down and learning how these services work is the knowledge. I now have to knowledge to build bigger and better applications. So basically you have to look at the time spent as an investment.

Later,

Joe

Copyright © 2024 Joseph Tinsley

Theme by Anders NorenUp ↑