Archive for May, 2008

The FriendFeed API

Thursday, May 29th, 2008

First off, let’s define aggregation as taking a bunch of things and putting them all in one place.

Let’s try something.  I’m going to read off a bunch of web services.  Which ones are you a member of?

  • Digg
  • Google Reader
  • Google Talk
  • Gmail
  • Mixx
  • Reddit
  • del.icio.us
  • Furl
  • Ma.gnolia
  • StumbleUpon
  • Jaiku
  • Pownce
  • Twitter
  • Seesmic
  • Vimeo
  • YouTube
  • Flickr
  • Picasa
  • SmugMug
  • Zooomr
  • Tumblr
  • iLike
  • Last.fm
  • Pandora
  • Goodreads
  • LibraryThing
  • Amazon
  • Disqus
  • LinkedIn
  • Netflix Queue
  • Netvibes
  • SlideShare
  • Upcoming
  • Yelp
  • or any blog
  • or anything else putting off an RSS feed

Each of these can be pulled into one feed by FriendFeed.com .

How many of those services are you a member of?  What do you do when you want visitors to see all your posts in one place?  Think about using FriendFeed and harnessing it’s API .  We’ll use it to create a single central feed out of the chaos.

So how does FriendFeed work?  Each member loads up their various accounts from around the web – Google Reader shared articles, Twitter posts, blog entries, YouTube videos, Flickr photos, del.icio.us bookmarks, all that stuff I listed earlier – and members can have discussions around each entry.  It’s a furious stream of information and comments coming from all directions. blogs, news, pictures, etc – all flying by, with comments.  It’s the daily web posting activity of thousands of people in one place.

Facebook already has a nice FriendFeed app so your friends can see your FriendFeed-aggregated posts.

Otherwise showing it on another web page (like a very cool business’ web page) means we’re off to the FriendFeed API.

First thing we need is a FriendFeed account.  They’re free.  Go to friendfeed.com and follow the instructions.

Then load all of your web memberships into FriendFeed so you’ll have stuff in your feed.

Then we need to download the API from http://code.google.com/p/friendfeed-api/ .  Documentation and forums are available at http://friendfeed.com/api/ .

Then, in order to authenticate with the API, we get our new account’s Remote Key from http://friendfeed.com/remotekey .

That’s all the official FriendFeed stuff we need.  Now on to our application.  I called it FriendFeedFormatter.

It is not affiliated with FriendFeed.  Use it all at your own risk. FriendFeed has stated that the API is young and could change at any time.  That disclaimer out of the way…

My code does all the work of taking our nickname and remote key and producing an HTML snippet from our FriendFeed feed that we can then have included in a PHP page.  Download example.zip from the show notes.  It’s got all the code that I’ve written using the API.

http://www.davidvanvickle.com/friendfeed/example.zip

In the show notes is a link to see sample output.  That will give you an idea of what to expect, and you can begin to think of how to embellish it.

http://www.davidvanvickle.com/friendfeed/build.php

There are only two files in example.zip.  One is my FriendFeedFormatter PHP class.  The other is build.php, which is the file you’ll customize and run.

Now find the FriendFeed API you downloaded.  In order for my custom class to work, you’ll need to include the friendfeed.php file from the API in the same folder.

So when you’re done there will be 3 files uploaded to a folder on your PHP enabled web server.  friendfeed.php from the API, plus FriendFeedFormatter.php and build.php.

Before we try to run anything we need to change a couple things inside of build.php.  So open that file in a text editor.

Enter your FriendFeed nickname where it says “MY_NICKNAME”.  Then enter your remote key where it says “MY_REMOTEKEY”.  That’s it.  There are more things we could toggle but let’s start here.

So save and close build.php and upload the 3 files to the web server.  Now you should be able to hit your build.php with a web browser and see what happens.

If all is well then you’ll see the HTML table that the FriendFeedFormatter produced using the API.  Now look in the webserver folder where you uploaded the 3 files.  You should now see a 4th file.  That file is what you’ll be including in your normal web pages.  It is JUST the HTML table displaying your feed.  Just a little piece of a web page, not the whole thing.  Perfect for inserting into a page that already exists.

Why don’t I just write a Javascript snippet like everyone else?  Well because I don’t want to slow my web pages with a call to a remote site.  The FriendFeed servers are pretty fast, but I still don’t want that dependancy if I can help it.  As long as I can run that build.php file on a regular basis, I will have a new enough include file for my site.  And it will load right away.

So how do I run build.php on a regular basis?  Good question.  If you want to automate that, I have half an answer.  If you’re familiar with running cron jobs, or if you want to learn how, cron would be a good way.  Cron allows your server to perform a task – such as calling build.php – according to a schedule, like every few minutes, instead of waiting for a web user to come along and trigger it.  Cron is usually running already.  You don’t have to install it.  Just add a crontab to call lynx, wget, or on older servers, the php cgi executable and pass it build.php and how often it should run.

Truth be told, I don’t have much experience with cron, but it seems to be where people go for scheduling scripts.  I included some examples in the show notes that I scraped from the web to get you started.  I’m sorry that I don’t have more tested examples.

Run every Monday morning at 4:41AM.  (minute hour day month weekday command)

41 04 * * 1 /path/to/lynx http://www.mydomain.com/path/to/your/cron.php
or
41 04 * * 1 /path/to/wget http://www.mydomain.com/path/to/your/cron.php
or
41 04 * * 1 /path/to/php /path/to/your/cron.php

Samples from:
http://www.hackernotcracker.com/2007-04/run-php-scripts-with-crond-and-crontab.html
http://www.modwest.com/help/kb.phtml?cat=2&qid=105

More at
http://www.webmasterworld.com/forum40/1258.htm

Otherwise just keep build.php bookmarked and hit it every time you do something that updates your feed.

Fortunately for server performance, but unfortunate for us, is that FriendFeed is on it’s own schedule.  Just because I update my blog, doesn’t mean FriendFeed is immediately aware of that post.  It may take a few minutes for it to show up in the FriendFeed feed.  (That’s a great reason to figure out how to make the cron way work)

The code to pull in the include file in your PHP page is the same code in build.php that displays the output in the browser.  The FriendFeedFormatter->get_output() method.

Once you see the output, I’m sure you’ll want to customize it more.  Go for it.

I built in a few enhancements.

One enhancement is date formatting.  The date may come to you a couple different ways.  One is in ISO8601 format.  That looks like this. “2008-05-21T15:02:22Z”

Another format would be as a UNIX timestamp, or a long number that represents the number of seconds since January 1, 1970.

You should be able to look in the date column, see which kind of date you have, and change the value of the date format variable in build.php.

$ff_date_format = ‘ ISO8601’; // or ‘unix’

On one server I got one format, on another I got the other format.  I think that’s based on the PHP version I had running but I’m not sure.  Anyway, that’s why my code has two ways to format dates.Another customization is the title of the table.  I recommend making that a link to your Friendfeed page.  The current set up has a link to your FF page, plus a link to  subscribe to your feed.

The formatter has a couple features users may appreciate.  One is inline Youtube videos.  First the user sees a JPG image of the video, but when it is clicked, it turns into a playable video.

Another feature is link detection, which is programmed to happen with Twitter entries.  The static URL’s become clickable.

The last feature is, when Flickr is detected, it lists the thumbnails of the images.

These are things I expected to happen from the API, but they weren’t there, so I added them to my formatter.

Open the formatter and notice how I can treat each service’s entries differently.  I can detect Twitter, for instance, and scan the entry for URL’s to convert into links.  Or I can detect Youtube and make the inline play feature happen.

The important thing is just to hack away to get going using FriendFeed to aggregate your public web activity.

My Skillet video has over 200 views in 2 days

Tuesday, May 27th, 2008

This is the most popular thing I have done so far and it’s kinda crappy. Watch anyway. Ha ha.  It’s because Skillet rocks, I’m sure.

[youtube=http://www.youtube.com/watch?v=F7C2L3RwIbI]

PHP Programming with the FriendFeed API

Monday, May 26th, 2008

Problem
I want to display all of my published web activity (from podcast, YouTube, De.licio.us, blog, etc) in one place.

Solution
Use FriendFeed to pull in services, then use FriendField API to build a FriendFeed feed formatter which will build an HTML snippet file to be included on web pages. The snippet will display time-stamped activity from various web services. Display is customized by service. I created a PHP class named FriendFeedFormatter. It takes my FriendFeed nickname and remote key, and outputs the file to be included on web pages.

My FriendFeedFormatter PHP code:

Sample output | Download code ( updated May 28, 2008 )

Me on FriendFeed

My podcast episode explaining how to install and use this.

Drawing – Starving

Saturday, May 24th, 2008


Starving by ~vanturtle on deviantART

Online Marketing

Wednesday, May 21st, 2008
Most websites need marketing. Just because you build it doesn’t mean people will come. Maybe you’re a business and you want to sell products on the web. Maybe you have a personal web site and you’re thinking about advertising so you need traffic. Maybe you just want to learn how information proliferates throughout the web.It’s more than just you and Google. True, you need to address the “web at large” and pull in random searchers, but your efforts can be more targeted by finding networks where your market is likely to congregate. These are sites with a lot of like-minded people. They’re all there for similar reasons, like media sharing, link sharing, product reviews, whatever. There are social networks, bookmarking networks, link sharing networks, networks with bloggers, podcasters, artists, people doing home improvement. You name it, there’s going to be a network for it. Identify who your market is and what network they’re likely at. If you sell a painting product, browse the paint section of the home depot web site. See if people are leaving comments with links to external sites. If they are, look for a way to chime in on that page.All of your friends are on Facebook. If you think they should care about what you’re doing, then post an item whenever you have something they might be interested in. They are very likely to check out your recommendations as long as they’re not feeling spammed. Eventually they may remember you when they need your service.

You may also have an audience on Twitter. That site allows you to post just a one liner that might say “go check out this new content that I’ve produced”. Users expect you to post frequently about anything, so do just that. Another site, FriendFeed is like Twitter on steriods. Nice service. Just started exploring that one. It ties together a lot of the networks I talk about here.

http://friendfeed.com/vanturtle

There are different ways to figure out what the popular sites are, or how popular a given site is. Alexa.com ranks the top sites in general. Compete.com can compare any given sites and tell you how much traffic they have received over time in comparison with other sites. There are bookmarking networks like Delicious which lets you see how many people have bookmarked a given site on that service. There is Digg, where you can browse by category and see which stories on a topic are the most dugg.

Once you find a relevant site, maybe you discover that it has a links page which is likely loaded with even more relevant hand picked sites. The site finding goes on and on. Keep going back to compete.com to see how popular they really are. Remember you want to be on sites with the largest relevant audiences.

Keeping content fresh on your site is a good way to satisfy search engines and visitors. You may consider blogging, or in other words, having regular news releases about what’s going on with you or your business. Blog sites like blogger.com or wordpress.com are networks of users. When you post content, you may get hits from that community as well as your direct visitors. My blog at wordpress.com, which is vanturtle.wordpress.com, gets a lot of community hits. I tag my posts and wordpress.com visitors search by those tags and find my blog. If you know what your keywords are, you could go to wordpress and search by those words and see what blogs are relevant.

You could load the blog software directly onto your site, but then you’d miss out on these community hits. I try to maintain as many communities as possible instead of trying to load isolated software onto my comparably hidden domain. I want the community’s larger marketing effort to benefit me.

I also don’t try to reinvent the wheel. Popular sites may be popular because they do a single thing really well, and I’m best served by just being a part of that network anyway. So I use wordpress for blogging, Flickr for photos, youtube for video, and deviantart for art. Where they don’t do everything I want them to, maybe there is an API and I can program any missing features, or if I’m looking to integrate them into my domain I can. I could continue using wordpress.com for my blog, and also have my site pull my wordpress RSS feed and redisplay the posts there.

Something common in these sites is the ability to put snippets of code into another site to display your content from that service. So on my central domain I have a snippet for Flickr, a snippet for del.icio.us, and so on. That way people can see what I’ve got going on all in one place.

People have come to expect a search field on a site. Don’t think your menu is their first preference. Studies show half of site visitors go to search boxes before they try to figure out the menu. So if you can have a searchable site you’ll be making those people happy. Database driven sites are searchable. Content from wordpress is searchable. When you’re planning your site, don’t forget the search field, and make sure to store the content in a way that is searchable. That brings me to another point. Don’t use art for headlines or body copy. Don’t use Flash unless you’ve got a multimedia presentation or a video. I love Flash, but search engines don’t, so I want to make all my text actual text and not art. When people search, I want to be found.

Besides being searchable and search engine friendly, blogs are also subscribable. It’s a good thing if you are broadcasting your updates to people who care. Being subscribable means your content is putting out an RSS feed. This is an XML file that keeps your fans connected to your updates. So it’s a good way to pull in hits.

Sometimes when bloggers end up with more important things to do, as if that was possible, people don’t need to sleep, blogs start to go a while without updates. This can happen to podcasts as well. Not this one of course. Actually I have been less frequent than weekly, so I apologize. But back to topic. Don’t let it happen to you. Figure out a daily or weekly or monthly routine so you keep that feature alive and working for you.

How do you know if you’re getting hits or not getting hits? Use Google Analytics. That a fantastic free tool from google that lets you see where people came from, what keywords they typed to find you, what pages they came in on, what pages they left on, how long they stay on the site, how many unique hits you get a day. Definitely set up an analytics account.

If you actually have a respectable user base, consider a couple other things. One would be a user forum. This is where your visitors can produce content for you, and keep your site alive with maybe less content production effort on your part. The other thing would be to allow comments on your pages. Maybe you don’t want comments on your “About Me” page, but you should definitely consider them on your blog entries. Allow people to contribute. You can usually make it so you can approve comments before they go live on your pages. This is the case with wordpress. Comments are awesome on news sites and software documentation pages. Comments can expand a topic and make the page more valuable for visitors.

Something you need for your content, your blog tags, your titles, your advertising is keywords. So figure out what you’re about, who you’re targeting, what your market’s keywords are and put them to use. I put some keyword tools in the show notes.

Once you have keywords and a little cash you might consider Google Adwords. You make a three line text ad, attach a bunch of your keywords, and Google will drive hits to your site. You might try a monthly budget of $50, and Adwords won’t ever charge you more than that. It’s safe and easy to advertise there, and it’s in yours and Google’s best interest that you get clicks with the ad and hits on your site.

Before you start advertising, make sure to get lots of incoming links by posting comments on relevant networks. The more incoming links you have the higher you’ll show up in search results. That’s not easy, but I never said it would be. It’s a lot of hard work to get traffic on your site. You have to have something of value. We have to work the web with our contribution of quality targeted content on our sites and on relevant networks.

SEO and Keyword Tools

Articles
http://www.problogger.net/archives/2008/02/04/how-to-herd-organic-search-traffic-to-your-blog/#more-5307
http://www.toprankblog.com/online-marketing-blog-resources/

Google
https://adwords.google.com/select/KeywordToolExternal
http://www.google.com/webhp?complete=1&hl=en
http://labs.google.com/sets
http://www.google.com/trends/hottrends

Other
http://adlab.msn.com/kts/KCAT.aspx
http://tools.seobook.com/spelling/keywords-typos.cgi
http://www.keyworddiscovery.com/
http://freekeywords.wordtracker.com/

Drawing – Band Members of Found

Sunday, May 18th, 2008


Band Members of Found by ~vanturtle on deviantART
Copyright David Van Vickle. All rights reserved.

First videos posted

Saturday, May 10th, 2008

http://www.youtube.com/macvickle

Finally got around to posting some videos.  So far 3 vacation videos:  2 from last month’s Niagara Falls trip, and 1 from Italy from a couple years ago.

Drawing – Snake Angel

Saturday, May 10th, 2008


Snake Angel by ~vanturtle on deviantART
Copyright David Van Vickle. All rights reserved.

Twitter

Saturday, May 10th, 2008

Have you ever wanted to say something on the web, but it wasn’t long enough to blog so you held back? If that happens a lot, you may want to check out Twitter.

www.twitter.com

“Twitter late night is kind of a swinging place, full of insomniacs, the caffeinated, and Australians. I dig it.” – Leo Laporte

I’ve tried integrating it with Firefox using Twitbin but later just switched to the Flock browser to enjoy it’s built in Twitter support, and I have a mobile version open on my phone.

getfirefox.com

flock.com

But what is Twitter? It’s a website where you go to answer the question “What are you doing?” in 140 characters or less.

Twitter allows you to “follow” people and get “followers”.

twitdir.com show the top 100 most followed people.

twitdir.com

Friends and followers are different. Friends have to be invited. Followers just show up. Fortunately there is a privacy feature that allows you to expose your tweets only to those you give permission to, which basically turns followers into friends.

So far I only have one real world friend that uses it. And the people who follow me, I also follow.

You learn what people are into or just checking out. Some posts are entertaining. Some people are fun to listen to. Other posts serve as recommendations. You find that some people are into certain foods or restaurants. Makes you wonder if you may like that as well. It’s a great way to get out of a rut. It encourages you to try new things.

Some of the common things often shared are links to cool web sites.

Have you ever sent a long URL in an email, and it broke, and the person who received it clicked it and only half the URL went to the browser. Then they reply to you and say “hey that link you sent doesn’t go anywhere”. If you have that problem you may want to check out tinyurl.com and snipurl.com. It’s very easy to go to those sites. You don’t need a login. Enter your long URL in the text field and it will give you a very short URL that you can copy and paste into your message.

tinyurl.com
snipurl.com

Besides following people I already know, I also found a bunch of people to follow by searching by city name. I was interested in seeing what the locals were into. It’s fun reading a stranger’s tweets as they talk about places you know about. After I did that I realized others were finding me the same way.

By the end of my recent vacation, where I only had my cell phone to connect to the internet, I was convinced that mobile web apps are something I need to take more seriously, and figure out how to develop them. Probably not much to it in the case of the iPhone, as it supports any web page already. You could probably just make a tiny version of the big version and redirect iphone browsers to it. I’m sure there’s a future podcast coming on that topic.

For Twitter I found a few iphone targeted web apps. One is called “JustUpdate”. It doesn’t show other people’s entries but it’s great at doing exactly what it’s called – just updating. It would remember my login for days and was great at quickly posting updates from anywhere. There is a link to that site in the show notes. You can also find it at apple.com/webapps.

http://m.ac.nz/justupdate/about.html
apple.com/webapps

The other handy mobile twitter web app was PocketTweets. This one is nice looking and somewhat full-featured. In addition to sending updates, I used it to view and reply to friends. It also has a star for favoriting entries. Check it out at pockettweets.com. It is also at apple.com/webapps.

pockettweets.com

Then there’s Hahlo 3. It’s ranked highly and recently updated. It seems to be the winner in terms of features. You can update, view friends updates, see your profile, and even customize it with from a Settings menu. It also has a feature that allows you to search all tweets, thanks to summize.com. Check it out at hahlo.com.

summize.com

hahlo.com

The last one I’ll mention is twitterforiphone.com. It was ranked high and looks nice. Unfortunately it was too slow for my taste when I tried it, so I’ll probably be sticking with the others. May not be their fault. Twitter seems to be working out some performance issues as they scale up.

twitterforiphone.com

Even without those web apps the full size Twitter site is pretty lightweight.

Guess enough people are running around with web enabled cell phones that these services find the mobile web investment worthwhile. I’ve heard that some people text on the their phones more than they email. That is a trend worth noting.

Twitter is growing in popularity. Part of the growth is because of the hype it’s gotten on the Podcasts. Hosts are addicted to talking about it. They try not to talk about it, but can’t help themselves. I’m thinking specifically about Leo Laporte’s TWIT podcast, which drove Twitter into my head week after week.

It also probably grew because of the political race. The candidates are using Twitter to publicize their events to the web community.

What a publicity platform. That is, if you can get enough followers. I follow internet celebrities. They tweet throughout the day and have thousands of followers. At last count I have 13, to put this into perspective. For me it’s just fun. For them there is a business crossover. With thousands of followers, it’s value to a business is obvious. If you have that many people listening to you, every link you post will get hundreds of hits instantly.

A podcast could announce it’s new episodes, a politician could publish his public agenda, or a news person could provide up to the second coverage of an event.

According to compete.com, in April, Twitter had over a million users and had grown 30% that month.

http://siteanalytics.compete.com/twitter.com/?metric=uv

Twitter isn’t just a US thing. Twitter’s own blog says that in February, only 40% of their traffic was from the US. The next largest groups are Japan, Spain and the UK.

http://blog.twitter.com/search/label/stats

Maybe you want to integrate Twitter into your web site or develop a web app using their API. Just click the “API” link at the bottom of the homepage and off you go. There is also a link to the documentation in the show notes.

http://groups.google.com/group/twitter-development-talk/web/api-documentation

The API gives you access to lots of neat stuff including methods to access statuses, direct messages, friendship, favorites, notifications, and blocking.

If you have Curl installed there are examples of how to use it to play around with the API. Responses can be formatted in a few specified ways including XML, RSS, Atom and JSON. The show notes have a JSON example for getting friend updates.

curl -u email:password http://twitter.com/statuses/friends_timeline.json

Just open a command prompt and type “curl -u” followed by your account email “:” password followed by the twitter “friends_timeline” URL with the extension of the format you want. In the case of my example, the URL ends in “.json” because I want a JSON response. If you’ve ever touched a command line, or even if you haven’t, it’s pretty simple.

So in conclusion, Twitter is a fun distraction that gives you insight into other’s people’s minute by minute thoughts. Thoughts that in an of themselves are not much to write about, or even blog about, but you can be happy twittering about.

Top 5 Podcasts for May

Thursday, May 8th, 2008

Somehow I skipped a month.  Darn.  My top 5 have shifted once again.  Here they are.

  1. Tech5
  2. Amtrekker
  3. TWIT
  4. Cute with Chris
  5. Internet Superstar