April 15th, 2008
This is an update for my previous Youtube Downloader.
If you don’t know what is PHP Youtube Downloader, it is a simple PHP script that we can use to download video from Youtube.com. You must, at least, having PHP installed and CURL activated.
Download the source at here and read some information at Google Code Page.
Have fun!
Tags: curl, grabber, PHP, youtube
Posted in PHP | 1 Comment »
April 10th, 2008
Ars Technica just wrote an interesting article about their experience using Mozilla’s mobile browser which its codename is Fennec. It’s still on their early stage of development so we can’t give it a try. Thanks to Ars Technica for following screen capture of Fennec Mobile Browser:

They reported that Fennec suit on Nokia N810 for the showcase. There’s no further information on which platform they will play. Will it be Linux, Windows Mobile, Symbian OS or even Java based?
Mozilla said that they want to ”transfer” the feel of browsing using Mozilla Firefox into this handheld browser and featuring synchronization between Mozilla Firefox and Mozilla Fennec.
Based on Wikipedia, Fennec is a small fox found in the Sahara Desert of North Africa (excluding the coast) and in some parts of Arabia.
Tags: Browsers, fennec, mobile browsers, mozilla
Posted in Browsers | No Comments »
April 2nd, 2008
From Opera Mini’s official blog saying that new beta for Opera Mini is coming soon. They’re not giving us list of new improvements but they gave a clue that the new improvements are wanted by most users.
There’s no statement about the release date. All we can do is just waiting for the next information, for both Opera Mini and Opera Dragonfly, hopefully.
Posted in Browsers | 1 Comment »
April 1st, 2008
After a few years using my own blog script –yeah, bleedy script, written from scratch– I finally decided to use Wordpress for this blog.
There are a lot of things to do such as syntax highlight, re-arrange the messy source code inside a blog post etc. But one for sure, you can still access any post using the old URL.
Yes, the URLs are not changed.
Posted in Blog News | 3 Comments »
March 3rd, 2008
For more than a month my youtube downloader script was not working due to youtube changed their layout. Today I’ve rewritten the script and simplified the functionality. Now mobi.web.id is running again and ready to help everyone download videos from Youtube.
Previous script consist of four functions and I’ve shortened into two functions. Please hit the read button to see the full working script.
Here’s the shorten code for youtube downloader:
function get_http_header($url){
$uh = curl_init();
curl_setopt($uh, CURLOPT_URL, $url);
curl_setopt($uh, CURLOPT_HEADER, 1);
curl_setopt($uh, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($uh);
curl_close($uh);
return $res;
}
function show_url($http_header){
$arai = explode(”\n”,$http_header);
foreach($arai as $ini){
if(eregi(”location”,$ini)) $url = $ini;
}
list($sampah,$hasil) = explode(”Location:”,$url);
return str_replace(”\n”,”",trim($hasil));
}
function download_youtube($url){
if(ereg(’&',$url)){
if (eregi(”watch\?v=(.*)&”, $url, $out)) {
$video_id = $out[1];
}
}
else{
list($none,$video_id) = explode(’watch?v=’,$url);
}
$secret_link = substr(show_url(get_http_header(’http://youtube.com/v/’.trim($video_id))),11);
$video_url = show_url(get_http_header(’http://youtube.com/get_video?’.$secret_link));
list($dl_url,$sign) = explode(”&signature”,$video_url);
return $dl_url;
}
// EXAMPLE:
echo download_youtube(’http://www.youtube.com/watch?v=5uy7SAidyTM’);
?>
Have phun, may the source be with you! ^_^
Posted in PHP | 9 Comments »
February 27th, 2008
As you may see in this blog, all PHP codes will be highlighted so they become readable and looking good. This time I will share my script to highlight the code inside a bunch of text.
Yes, it will highlight string inside [code] and [/code] only, like following sample:
Here is a sample of PHP script:
[code]
<?php
if($name == ‘neo’){
echo ‘Hei you!’;
}
?>
[/code]
then save it as sample.php.
The result will be displayed as follow:
Here is a sample of PHP script:
if($name == 'neo'){
echo 'Hei you!';
}
?>
then save it as sample.php.
Now we see the magic behind the highlighting process:
// function to call
function highlight_code($txt){
$hasil = preg_replace_callback('{\[code\]((.|\n)+?)\[/code\]}i',"replace_code", $txt);
return $hasil;
}
// main function
function replace_code($ketemu){
$hasil = trim($ketemu[1], "\n ");
return highlight_string($hasil, true);
}
// sample of usage:
$string = "It's PHP info: [ code ] [ /code ]“;
echo highlight_code($string);
?>
The main function is the replace_code()
function that will highlight the string. But we need to return the the highlighted string back into the full strings. So we use the callback, using highlight_code() function.
Good luck ^_^
Posted in PHP | No Comments »
February 26th, 2008
This is just a reclaiming this blog on Technorati Profile. Please ignore.
Posted in Blog News | No Comments »
February 26th, 2008
Opera Watch reported that they’re preparing something called Opera Dragonfly. There’s no clue what the dragonfly could be but a teaser said:
“I won’t say quite yet, but I do think that, in my opinion, it is the most important project we have on going at the moment, and probably since I’ve been at the company. It won’t directly affect everybody, but will hopefully become invaluable for those that it does.”
So I’m thinking that the dragonfly will be a developer tools to dealing with HTML/CSS/Javascript just like firebug in Firefox.
It’s great if the dragonfly is realy a developer tools, since the current developer tools available for Opera is not very handy and rather dificult to use. Let’s wait for the dragonfly.
Tags: mozilla
Posted in Reviews, Technical Stuffs | No Comments »
February 19th, 2008
This is a simple function I wrote to get a DPI (dot per inch) value from an image using PHP only, without the need of ImageMagick nor GD library. The script was inspired from denisb post (the third post). At the forum, he described how to get the DPI value stored within the file.
function get_dpi($filename){
// open the file and read first 20 bytes.
$a = fopen($filename,'r');
$string = fread($a,20);
fclose($a);
// get the value of byte 14th up to 18th
$data = bin2hex(substr($string,14,4));
$x = substr($data,0,4);
$y = substr($data,4,4);
return array(hexdec($x),hexdec($y));
}
// output the result:
print_r(get_dpi2('filename.jpg'));
?>
I have tried this function to get DPI value of an image that I generated using Photoshop and worked as expected but failed to get DPI value from an image from any digital camera. It returned weird value instead.
Any idea why this function failed to retrieve DPI value from image that generated by digital camera? Please share your opinion.
Posted in PHP | 2 Comments »
February 8th, 2008

You might questioning what happen with Opera Mobile version 9 and why Opera Mobile jumps its version from 8.65 to 9.5.
Opera Mobile is intended to be a replacement for Opera Desktop in a mobile device. To achieve the same browsing experience between desktop and mobile, both browsers must have the same method to display the website. Since the latest version of Opera Desktop is 9.5 so Opera Mobile should have the same version and same rendering engine. Opera Mobile 9.5 using the same rendering engine as Opera Desktop 9.5 called Presto.
By this way, Opera hopes that there’s no difference between browsing using PC or mobile gadgets. Opera also said that this version is a lot faster than previous and the GUI was completely rebuild to increase user experience. And hey, it runs widgets just like Opera for desktop!
Now I’m waiting for Opera Mobile 9.5 to be available for Symbian UIQ 3.
Tags: mozilla
Posted in Browsers, Reviews, Technical Stuffs | 3 Comments »