Posted by clintcan on October 27, 2009
One of the most popular social networking sites today is facebook. As of this time, the social networking site boasts of over 300 million users, which is pretty hard to ignore, considering marketing value.
What makes facebook interesting are its applications; which are mostly user created, and add life to the social networking site.
Here’s how to submit a facebook application to the net:
1. Join as a facebook developer, and on the http://www.facebook.com/developers/ url, click on the Set up new application button

2. On the Create App page, type in the name of your application

3. Take note of the API Key and Secret; you’ll need these later. Fill up the necessary items in the Basic Page.

4. Enter the canvas url (where your application will reside in apps.facebook.com), and the content url where your application is hosted.

5. Press Save, and you’re off to start a brave new world of creating a Facebook Application!
The simplest start for a facebook application looks like this:
require_once 'php/facebook.php';
require_once 'config.php';
$facebook = new Facebook($api_key, $secret);
$user_id = $facebook->require_login();
echo "Hello, $user_id!";
facebook.php is the facebook php client which you can download in the developers site. You can learn more about the api in the http://wiki.developers.facebook.com/ site.
Have fun!
Posted in Uncategorized | Tagged: facebook, php | Leave a Comment »
Posted by clintcan on September 20, 2009
The religious community that I’m in delves into media. In fact we have a website that showcases video and audio materials for free.
We use the ever popular video/media flash player made by Longtail Video to stream our mp3 and video files to be distributed and seen by people in the web.
As we host our mp3 files in mypodcast.com, the rss feed that is delivered my the site isn’t exactly compatible with the player – so I had to parse the rss feed and re encode it into an rss feed that the longtail player recognizes.
In order to not reinvent the wheel in reading rss feeds, I used the ever popular open source (BSD-licensed) php feed reader, simplepie.
Below this page is the quick and dirty code that I used. I hope this will help you get started in the world of podcasting!
<?
require_once('simplepie.inc');
$feed = new SimplePie('http://host/rss.xml');
set_cache_location($_SERVER['DOCUMENT_ROOT'] . '/cache/');
$feed->handle_content_type();
?>
rss feed name
get_items() as $item)
{
$title = $item->get_title();
$date = $item->get_date();
if ($enclosure = $item->get_enclosure())
{
$media = $enclosure->get_link();
$length = $enclosure->get_duration(true);
}
$subtitle = $item->subtitle;
$description = $item->get_description();
//print_r($enclosure);
$desc = explode("","",$image);
echo "
$title
$author
";
}
?>
Posted in Programming, php | Tagged: flash, longtail media player, php, podcast, simplepie | Leave a Comment »
Posted by clintcan on September 8, 2009
I found this sooo strangely familiar to what happened on the ISO standards committee on the OOXML approval process.

Posted in Uncategorized | Tagged: Dilbert, ISO, Microsoft | Leave a Comment »
Posted by clintcan on September 7, 2009
Heywatch is a cool video encoding web service that is being used by different clients like Sony, Fotolia, Kickapps, MTv, among others for their video conversion needs.
One nice thing about this service is that it has a REST based API that is simple to implement in php. However, the documentation that comes with heywatch shows only how to access the API using PEAR – this becomes a disadvantage if your shared hosted webhost doesn’t have PEAR installed. I also personally think that using PEAR just to call this api is basically overkill.
Why not use curl instead? I basically changed the PEAR functions in the API documentation to that of php curl functions (which are basically native and available in practically all shared php webhosting)
<?
$video_url = "http://osaddict.com/files/elephantsdream-480-h264-st-aac.mov";
$format_id = "1086"; // 1086 for flash h264, 31 for flash flv
$ftp = "ftp://username:password@ftphost.com";
$ping_after_encode = "http://host/heywatch/success.php?myvideoid=5&myuserid=1";
$ping_if_error = "http://host/heywatch/error.php";
$ch = curl_init();
$your_username = "";
$your_password = "";
$video_url,"format_id"=>$format_id,"automatic_encode"=>"true","ftp_directive"=>$ftp,"title"=>"My Video Title","keep_video_size"=>"true");
curl_setopt($ch, CURLOPT_USERPWD, $your_username.':'.$your_password);
curl_setopt($ch, CURLOPT_POSTFIELDS,$arr);
$data = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
exit;
} else {
curl_close($ch);
}
header("Content-Type: text/xml;charset=UTF-8");
header("Pragma: no-cache");
echo $data;
?>
What this code does is to download a video, convert it to h264 flash format, then upload it to a select ftp host in just one step (success.php and error.php are ping functions where the developer is notified if conversion was successful or not).
One thing to take note is that heywatch doesn’t like special characters in the ftp url, if you place such characters in the $ftp variable, heywatch upload fails.
Have fun!
Posted in Programming, php | Tagged: curl, flash, heywatch, php, REST, video | Leave a Comment »
Posted by clintcan on July 14, 2009
Working for a company that allows you to experiment with different technologies can be a very satisfying (and sometimes stressful, considering the deadlines) experience. Working in such an environment also lets you encounter people that even in your wildest imaginations would never have thought of meeting in your lifetime.
A few years ago, while we were starting out (I was in the company even before it came to be one), my boss in our talks mentioned a familiar name, Jim Everson. For those who don’t know him, he’s the guy who led in the development of several educational games including the classic Broderbund game “Where in the World is Carmen Sandiego”.
Where does this all lead to, you may ask? In a nutshell, last year, Jim was diagnosed with advanced melanoma. Which led to his ex-wife (my boss’ sister) helping him out in whatever way she can – well, she helped design a website for him.
My boss asked a favor from me, to help quickly get some open source auction software and customize it for the website’s use, which I gladly did (as I was acquainted with him, and talked with him through emails in the past).
If it was not for open source software, we would have started programming from scratch, and would have taken much longer to finish (and at that time, I was up to my neck with deadlines at work). And, since the source code was there to see and customize, it was quick enough to implement it to their needs.
To end, if you do see Jim on your travels (he’s now an independent mac consultant), ask him about his mouth watering lamb chops recipe – he makes one mean lamb chops!
Posted in Programming, php | Tagged: auction, open source, php | Leave a Comment »
Posted by clintcan on June 13, 2009
I happened to chat with Jay Klepacs, aLinux creator, a little over a month ago (we’ve been friends since 2000s, during the PeanutLinux days).
If you’re wondering what aLinux was, it was a linux distribution derived from looplinux and was basically a hybrid of sorts (in it’s early days, it was very slackware linux inspired, but sporting rpms as it’s package format) and was featured in distrowatch years ago.
http://distrowatch.com/weekly.php?issue=20050829
I asked him how he was, and what’s up in aLinux land (which hasn’t seen a release for quite a while). In fact, I haven’t worked on pnutproject for quite a while either with Craig… real life since has taken over and I’ve been working quite busy for a start up company which I’ve been in for almost 3 years (never had so much fun programming and doing cool stuff with linux too!).
To make the long story short, aLinux lives, but not for distribution… yet. I don’t know if Jay would release it to the public either (it still uses KDE 3.5.x, btw which I still prefer over KDE 4.x).
Anyways, here’s the screenshot for you to enjoy. Have fun!

Posted in Linux | Tagged: aLinux, distrowatch, kde, Linux, PeanutLinux, pnutproject | Leave a Comment »
Posted by clintcan on March 24, 2009
A friend of mine asked me to help him set up linux on his newly purchased Lenovo laptop (doesn’t have an OS preinstalled). Few observations:
Ubuntu Intrepid failed to install on this laptop (messed up X resolution when it goes to the ubiquity setup screen).
Fedora 10 does install successfully.
There are two hardware gotchas that do not work after install, namely, the touchpad and the wireless. The laptop’s webcam gets detected and runs out of the box.
For the touchpad problem, disabling then enabling the touchpad by pressing the Fn+F8 key combination on the login screen twice does the trick.
As the wifi card of this laptop uses the Broadcom chipset, we have to install the Broadcom driver from the non-free repository of the rpmfusion website:
su -c ‘rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm’
and then running
su -
yum update
yum install broadcom-wl
and then rebooting the laptop will enable the user to use his wifi with no problems at all.
Posted in Linux | Tagged: Broadcom, Fedora, Fedora 10, Lenovo, Lenovo 3000 G430, Lenovo G430, Linux, Synaptics, touchpad | Leave a Comment »
Posted by clintcan on November 10, 2008
You might have heard of ssh2 pecl bindings for php. Unfortunately, the “stable” version fails to compile for php 5.2.x.
I am providing source rpms for CentOS/RedHat which fixes this problem. Please take note I’m using a free file hosting service to host this source rpm. If you know of anything better than this, please tell me.
CentOS/RedHat php-pecl-ssh source rpms
There’s a useful link below that should help you get started with php ssh2:
Make ssh connections with php
Posted in Linux, php | Tagged: CentOS, Linux, pecl, php, RedHat, ssh2 | Leave a Comment »
Posted by clintcan on November 8, 2008
SmartBro Prepaid is a mobile broadband solution which consists of a HSDPA capable modem and prepaid sim card. There are two type of these modems available, I am going to talk about the second, newer modem (the smaller black usb dongle), as the first one already has howtos available in the internet. For the curious – this dongle is called the Longcheer, and is based on the Alcatel OT-X020 modem chipset.
Although this writeup is based on setting it up on Ubuntu Intrepid, the following steps should be applicable to other distributions as well. You may want to improve on these steps by placing these commands on a bash script, but what I’m giving you is the staightforward way of doing it.
Here are the steps:
Download the usb_modeswitch binaries and the latest usb_modeswitch.conf file here:
http://www.draisberghof.de/usb_modeswitch/#download
Extract the usb_modeswitch binary and place it in a place like /usr/sbin. usb_modeswitch.conf goes to the /etc folder. Comment out the lines which has the headers Alcatel OT-X020. You have to disable the other modem enabled on this config file, or usb_modeswitch won’t work.
Edit your wvdial.conf file (located in /etc) to look like this (As a bonus, I added a default dialer section for your nokia cellphone – I have a Nokia E61i to connect to the smart internet network):
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","internet"
Modem Type = USB Modem
ISDN = 0
Phone = *99#
Modem = /dev/ttyACM0
New PPPD = yes
Baud = 460800
Idle Seconds = 3000
Auto DNS = 1
Stupid Mode = 1
Compuserve = 0
Dial Command = ATDT
Ask Password = 0
FlowControl = NOFLOW
[Dialer smartbro]
Init1 = ATZ
#Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init2 = ATE1
#Init2 = ATE0V1&D2&C1S0=0
#Init3 = at_opsys=0
#Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Init3 = AT+CGDCONT=1,"IP","smartbro","",0,0
Modem Type = USB Modem
ISDN = 0
Phone = *99#
Modem = /dev/ttyUSB0
New PPPD = yes
Baud = 912600
Idle Seconds = 3000
Auto DNS = 1
Stupid Mode = 1
Compuserve = 0
Dial Command = ATD
Ask Password = 0
FlowControl = NOFLOW
Write down this code and save it as initmodem.sh and place it in /usr/sbin:
#!/bin/sh
modprobe usbserial vendor=0×1c9e product=0×6061 && usb_modeswitch
sleep 3
Plug in your SmartBro USB dongle and run:
# sudo /usr/sbin/initmodem
To connect to the internet, just type in:
# sudo wvdial smartbro
and to disconnect, just press CTRL+C, or kill the pppd process
I think this should work also with SmartBro 1500 as well. Enjoy your smartbro connection!
Posted in Linux | Tagged: 3G, Alcatel OT-X020, HSDPA, Intrepid, Linux, nokia, SmartBro Prepaid, ubuntu, usb_modeswitch | 12 Comments »
Posted by clintcan on November 6, 2008
Hello World!
This would be my first blog post about Open Source and Tech stuff. This would also be my personal blog site as well (I’ll try to be figuring out how to categorize these writeups in this blogging site, so please be patient with me
)
Funny thing how this came about. I’ve been wanting to do this for years, but haven’t gotten to it until now. In the past I’ve written articles for wine-reviews like playforlinux, and some other stuff for a friend of mine Tom Wickline, and helped out on a few open source projects like aLinux and pnutproject (even was a wine applications maintainer).
To make the long story short, I landed a job in a small tech company, and got sooo busy, that I had hardly time to tinker around like I used to… until now
So here I am, running Ubuntu 8.10 on my Neo Vivid 1100 (installed through Wubi) on a SmartBro Prepaid Account (coz my internet got messed up).
Anyways, that that. I’ll be writing stuff for the next few days when I’m not that busy – starting with how to connect to smartbro prepaid – probably
Posted in Uncategorized | Tagged: aLinux, hello world, Neo Vivid 1100, pnutproject, smartbro, ubuntu, Wubi | Leave a Comment »