Perl Archives - Page 2 of 4 - Stay N Alive

Using Perl/Catalyst and Want to Use Sometrics? Try This.

logo.pngI’ve been analyzing various Social Applications Analytics tools lately, and have recently stumbled upon Sometrics. Sometrics handles full Analytics for your Facebook, Bebo, and MySpace applications, and will actually utilize the Facebook API to retrieve demographic info about those visiting your Application. As I examine the other Analytics solutions for Facebook and other Social Network Applications, I’ll try to post my findings of their strengths and weaknesses here, OpenSocialNow, and FacebookAdvice.com. If you’re not a techie, you may want to skip the next part, or forward it onto your IT department.

One thing I noticed about Sometrics is it seems to only provide code to paste on your Application pages for PHP, Ruby, and ASP.net. The code they provide is relatively simple, but in case you’re wondering how to do it in Perl, here is how I did it in Template Toolkit under Catalyst on Perl:

Enter this on all Application pages (I do it in my “footer” file):


[% IF Catalyst.request.param("installed") %]

[% ELSE %]

[% END %]

Then add this in the “post-remove url” subroutine for your Applicaiton (or create one and add the URL in your App’s config):

=head2 remove

  Page that handles App removal

=cut

sub remove : Local {

  my ( $self, $c ) = @_;

  if ($c->req->param(“fb_sig_uninstall”)) {

    $c->res->redirect(qq{http://halo.sometrics.com/met.gif?a=u&app=}.$c->req->param(“fb_sig_api_key”).qq{&uid=}.$c->req->param(“fb_sig_user”).qq{&age=&sex=&city=&state=&country=&friend=&src=fb});

    $c->detach();

  }

  return;

}

Who Said Perl is Dead?

perl.pngI’ve been following the issue list for Google App Engine (just realized it doesn’t have an “s” in the official name), and the two top issues are a dead heat between Perl and Ruby in the requests to have Ruby or Perl support. Ruby, as of this writing is at 361 votes, and Perl is right on it’s tail at 347 votes. Perl until a few hours ago was pretty far ahead of Ruby. PHP is only at 70 votes, and Java is at 247 votes.

Does this mean Perl is making a comeback? Did we ever really leave Perl? As an avid Perl developer this makes me happy, as Perl can do anything Ruby or even Rails can do, and even more (Perl XS and tie-ins to C are very powerful!). All of my current Facebook Apps and OpenSocial Apps I do in Perl on an MVC Framework called Catalyst – it’s very scalable! It never made sense to me when people said that “Perl was Dead”. Is this just a reflection of the type of Audience Google supports, or is it reflective of what new media developers are actually developing in?

I’m hesitant in posting this, as it could bring more Ruby voters to the mix, but hey, let’s keep it fair. If you want to vote for Perl, click on the star here. If you want to vote for Ruby, click on the star here. Not a developer of either? Then you’re on your own. 😛

I wonder how Python would fare if it got equal treatment.

UPDATE: Within just a day after this post things have gone back to how I would expect them to be. Java has a strong lead over all the others, followed by PHP, then Ruby, then Perl. Perhaps the issues just needed a little exposure. Based on the interest, Perl is still far from dead though.

Google Announces "Google Apps Engine"

google_appengine.pngOkay, so I was wrong – it was worth a try. I do still expect more large announcements related to Social Media from Google. Just recently, Google announced their “Google Apps Engine” (will it be nicknamed, “GAE”?). It is essentially a competitor with Amazon’s EC2, S3, and SimpleDB, but at a much higher level. You’ll be required to interface with the service via the Python Programming language at first, but it is intended to make scalability and server set up much easier. Google does say that the underlying infrastructure is entirely language neutral, so we should expect more languages in the future. The advantage over Amazon is Google takes care of all the server set up for you – this is essential for a small business that can’t afford to hire an expensive Linux Admin as Amazon requires.

The Service is only available to the first 10,000 developers that apply at http://code.google.com/appengine/, and will be available starting at 9pm PST tonight. You can read more at Venturebeat and TechCrunch here and here.

Well Done Guy! Chris DeVore is a Cheapskate

I just caught this article from Mashable and I just had to pipe in. In the article, Mashable’s Kristen Nicole claims Guy Kawasaki paid too much for the development of AllTop, at $10,000. They compare it to Askablogr.com, claiming Chris DeVore only paid $7500 for the development of Askablogr, with its rich feature-set.

I was blown away by this! Not that Guy Kawasaki paid $10,000, but that Chris DeVore only paid $7500 for Askablogr. Now, I don’t know Chris, so take this with a grain of salt, but some call it a deal. I say he’s a cheapskate! For something that will be your primary revenue source and your main line of business, $10,000 for something like Alltop.com is a steal! The fact that Chris DeVore only paid $7500 for his development means he’s either hiring offshore, doing the development himself (in which those costs are way under-inflated), or he’s very much underpaying a bunch of gullible developers that probably don’t believe much in the product they’re working on.

As a business owner, when supporting a technology-based business, it is of utmost importance that you put your developers and IT staff at first priority. They are your bottom-line, and should be the superstars of your business. You have to keep in mind that for top notch developers and technology, you’re competing with the likes of Google, Facebook, Yahoo, and others to get the best talent. By not paying your developers, you will either a) lose your developers very quickly, b) have a revolution at one time in your future and your developers will all back out on you in rapid succession, or c) not get the best work and skills you could be getting, and you’ll definitely run into scalability issues as your site grows in the future.

I recently finished the book, “My Startup Life“, by Ben Casnochas. I bet Guy’s read it and Chris hasn’t. In it, Casnochas talks about the lessons he learned by not paying his lead developer well. He quickly had threats of the staff to leave, and they quickly ran into scalability issues due to the unexperienced offshores they were hiring overseas. In building a technology-based business it is of utmost importance that you pay and treat your IT staff well or it will come back to bite you in the future.

So, Kristen, I say Guy is the smart one in this case. I am willing to bet his site scales better, his developers are happier, and more likely to work with him in the future. Guy’s likely to get millions for Alltop.com in the future, should it succeed, so $10,000 is a very small price to pay to get good developers on staff.

UPDATE: See Chris’s comment here: http://staynalive.com/articles/2008/03/21/well-done-guy-chris-devore-is-a-cheapskate/#comment-2126. I probably inappropriately labeled Chris a cheapskate while trying to defend Guy. It turns out (and I should point out, unless I read it wrong, that the Mashable article did not make this very clear either) that Chris’s project was a project built simply to point out how cheap something could be developed. In that case it would make him an intentional cheapskate, not that there’s anything wrong with that. As I mentioned, I’m a cheapskate too – I just don’t see the reason to short projects in development costs when it is the core to the business. It is an interesting experiment regardless. Thanks for visiting Chris!

Twitter Opens Their Messaging Platform

Today, in the first post on the new Twitter Technology Blog, Alex Payne announced that Twitter is releasing their underlying messaging platform, which they call, “Starling”, to the community. From the announcement it appears Starling is the basis for handling all communication underneath Twitter, speaks memcached, and reminds me in some ways of Perl POE, for Ruby. This is the development baby of Twitter, a great move by the new head of Engineering for Twitter, and a great benefit to the development community! Twitter is starting to remind me very much of Google in its philosophies, starting with a core technology, focusing on that, then figuring out monetization after the fact, all while giving back to the community. Way to go Twitter!

Jesse Stay is Now a Bebo Developer and Consultant!

That’s right – you may now add Bebo to my list of expertise. You may notice there’s a new category to the right – “Bebo”. The popular website Bebo.com, that I guess one could compare much closer to MySpace than Facebook announced late yesterday night that they were opening up their platform to developers. Before this, the platform was open to a small number of developers developing in a private beta of their application space.

Bebo Developer

I have started delving into their API, and I have to admit – I’m impressed! Their system is much more responsive than Facebooks (Facebook was recently rated as one of the slowest Social Networking sites), and in setting up a basic app, I have to admit it is a little more user-friendly than on Facebook. While it is much more user-friendly, Bebo has striven to maintain compatibility with Facebook. Almost every aspect of their API, from the API itself, to its FBML derivative called SNML is near duplicate. Bebo denies being the first to use the 3rd party partner-licensed platform Facebook is soon to release, but I have to admit, Bebo has done an excellent job at replicating what Facebook has done. If only Google could do the same with Open Social. Could this bring the developer community over to Bebo from Facebook?

Stay tuned – on SocialOptimize.com we’ll be posting some white papers on statistics surrounding Bebo, demographics, traffic, users, etc. as we find them. My partner, Allan Young is hard at work putting those numbers together. In addition to that, I’m working on migrating the WWW::Faceboook::API Perl libraries over to Bebo.

On a side note – one ironic thing I found about Bebo is that somehow, my 84 year old Grandmother is on Bebo. She has been sick lately, so I can’t imagine how old that account is. How many people can say their Grandmother is their friend on a social network??? 🙂

Stay N’ Alive Has a New Design!

I’m proud to announce the new design of the Stay N’ Alive blog. Yes, that is me on a Segway, a little slouched, but my real, geeky self, having fun. I’m tempted to subtitle the blog, “A Developer, Having Fun!” Really, that is what being a developer is all about – if you’re not having fun, find something else! I sincerely love what I do – at heart, I will always be a developer, a Geek at heart.

Another geek at heart, Bill Gates, gave his final keynote address at CES last night. He left a hilarious, yet touching video making fun of what his final day could be like. I have to admit, as a Linux and Mac user primarily (I use Windows for my Entertainment Center experience), I was a little choked up after this. I became a programmer because of Bill Gates, working on MS DOS machines, Windows 1 (came on a 5″ floppy), 2, 3, 3.1, and 95 way before I was ever a Linux user. I owe much of my experience as a programmer to this man – while we make fun of him, he is an inspiration to us all:

Rails Maintainers (and Users), Take a Hint!

It appears I’ve caused quite a stir in my post about asking Perl to step up. Joey DeVilla on Global Nerdy thinks I’m funny. Several Perl users, including Andy Lester (author of WWW::Mechanize) have corrected me on the fact that it does not require testing for modules to be submitted to CPAN – I stand corrected (I was writing this late at night when I wrote it, as I am now, so bear with me).

This still brings me back to my point that regardless of whether a module has to go through rigorous testing or not to be on CPAN, CPAN contains one of the strongest architectures to prevent bad code from being submitted available. When modules are submitted, they still have access to a large group of testers that will return test results to you and give you feedback. The Perl test suites included in the Perl packaging tools (Test::More, etc.) are some of the strongest unit testing tools I’ve seen.

Andy Lester himself is a great example of why I think Catalyst and other Perl tools and frameworks are much stronger than those of Rails, and have a much stronger and smarter group of developers maintaining them. He is the essence of a true “computer scientist” IMO. From his biography on O’Reilly:

“Andy Lester started with computers early by keypunching letters to Grandma on IBM 029 punchcards. Now into his third decade of professional software development, he’s the QA & Release Manager for Socialtext. Andy is also in charge of PR for The Perl Foundation and maintains over 25 modules on CPAN. Andy’s two latest book projects are Mac OS X Tiger In A Nutshell from O’Reilly, and Pro Perl Debugging from Apress.”

How many of the Rails programmers can say they keypunched letters into punchcards early on? Maybe a few, but I think Zed has a point. Andy himself isn’t a contributor to the Catalyst source code (that I’m aware of), but his skills and experience to me show the breadth of who a Perl programmer is, and the type of people maintaining the Perl Catalyst MVC Framework.

So I guess what I was saying in my previous article is that perhaps some of these programmers, such as John Rockway, Marcus Ramberg, and even Andy Lester or Larry Wall (whom everyone would take notice) should take this opportunity, now that it is in the public eye, to expose what Catalyst brings to the community – why should one use it over Rails? I’d like to see these guys show, through the experience and Computer Science backgrounds that they have, that Catalyst is one of the best options out there for building a scalable web architecture. I’d even suggest each address Zed himself, inviting him to give it a try!

As to the Rails supporters that were commenting, criticizing, and laughing at my “Perl Power” speech previously, perhaps you should step back and learn, rather than laugh at us. I know many of our own that are learning other languages, trying to learn from the Zed experience, trying to figure out how we can better apply principles that Rails brings into our own Frameworks, what works, what doesn’t – you get the point. Those criticizing what I have said, IMO, are simply further proving Zed’s point to an outsider like myself.

Patches to the Net::Twitter script for all followers and friends

As I was testing my auto follow script for Twitter and helping Chris Pirillo (see the comments in the link above) get his set up, I realized it wasn’t working for him. After a ton of hacking around, going through all aspects of the auto follow script, and Net::Twitter, I realized there was an undocumented (it’s now partially documented) feature in the Twitter API which states that a page must be specified with a “friends” or a “followers” request. I noticed that Net::Twitter was not checking for paginated results on these requests, therefore I’ve created a patch to make that possible. You can download that patch here (after installing Net::Twitter):

http://www.jessestay.com/Net-Twitter-jessestay.patch.gz

Just patch Twitter.pm (usually in /usr/lib/perl/site_perl/5.8.8/Net/Twitter.pm) with the above file (after un-gzipping it), and you should be set.

Twitter Development and Follow Blacklists

I’ve been playing with a new site lately that will be doing some integration with Twitter (more about that later). I realized the other day that several people that were following me, but I wasn’t following, weren’t being added to my friends list with my Twitter auto follow script.

I researched the issue, and realized that while the API calls were being made, and Twitter was responding as though I was now following them, when I would go back to the Twitter UI it would show up as myself not following them still.

For those unaware, there is a Twitter Development Google group that you can subscribe to to discuss Twitter development. The Twitter devs follow this group and openly answer questions about Twitter development. I mentioned my problem there, and after some going back and forth to convince them there was a problem, they responded.

It turns out that Twitter actually has their own Blacklist internally. If you try to follow too many people within a short time you can easily, at least temporarily, get blacklisted from anyone following you, or you following anyone else. This is why my API calls were not working on some individuals – at the API level Twitter acts as though they are being followed, but in the end they aren’t. The Twitter devs said they are working on a better blacklisting system for the future, and will expose the API to that when it becomes available.

So, for those holding out for ability to blacklist spammers on Facebook, it could be coming soon! It also brings comfort that Twitter is also taking measures to combat spam.