July
2

a2zVideoAPI Wordpress Plugin: http://blog.svnlabs.com/a2zVideoAPI.zip

http://wordpress.org/extend/plugins/a2zvideoapi/

Plugin Name: a2zVideoAPI widget
Plugin URI: http://svnlabs.com/a2zvideoapi/
Description: a2zVideoAPI allows you to adds a sidebar widget to show video from various sites including youtube, dailymotion, google, vimeo, metacafe, blip.tv, hulu, 5min, myspace, ehow, break, flickr etc.
Author: Sandeep Verma
Version: 0.7
Author URI: http://blog.svnlabs.com
Other: Curl must be on your server to use this plugin. This widget tested to latest version of wordpress.

Some API supported URL:
http://www.youtube.com/watch?v=mXMf9GOzzOA
http://www.dailymotion.com/video/x5z91e_lets-play-holi_music
http://video.google.com/videoplay?docid=-7577046582869136330&hl=en
http://www.vimeo.com/9573920
http://www.metacafe.com/watch/4230785/ghetto_star_weekly_randy_radermacher/
http://blip.tv/file/3272712?utm_source=featured_ep&utm_medium=featured_ep
http://www.hulu.com/watch/131066/saturday-night-live-we-are-the-world-cold-open
http://www.viddler.com/explore/coop/videos/54/
http://www.5min.com/Video/How-to-Organize-Your-Life-219728873
http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=51722257
http://vodpod.com/watch/2492783-reactos-install-screencast-tutorial
http://www.ehow.com/video_4983481_change-ip-address-windows-vista.html
http://www.break.com/usercontent/2009/4/How-to-Run-Linux-on-Windows-Ubuntu-699185.html
http://www.atom.com/funny_videos/sw_gangsta_rap_chronicles/
http://www.funnyordie.com/videos/4d47a07835/danny-mendlow-the-solution-to-racism-and-the-biggest-issue-in-the-world
http://www.flickr.com/photos/traceytilson/3033319841/

Installation:

1. Download a2zVideoAPI.zip
2. Extract and upload a2zVideoAPI.php to the plugins/ directory
3. Enable a2zVideoAPI Widget in the Plugin admin panel
4. Place a2zVideoAPI in the sidebar, and edit it to enter the Video URL

Other Links:
http://code.google.com/p/a2zvideoapi/
http://github.com/svnlabs

Download API: http://www.svnlabs.com/a2zvideoapi/a2zVideoAPI.zip
Download Plugin: http://blog.svnlabs.com/a2zVideoAPI.zip

Follow me:

Facebook: http://www.facebook.com/svnlabs
Twitter: http://www.twitter.com/svnlabs

Subscribe me:
Youtube: http://www.youtube.com/user/svnlabs
Feeds: http://blog.svnlabs.com/feed/

June
19

Framework: A web application framework is a software framework that is designed to support the development of dynamic websites, Web applications and Web services.

1. CodeIgniter
2. CakePHP
3. Zend
4. Symfony

CMS: A content management system (CMS) is the collection of procedures used to manage work flow in a collaborative environment. These procedures can be manual or computer-based.

1. Joomla
2. Drupal
3. Magento
4. CRE Loaded Oscomerce
5. Wordpress

April
30

Welcome to the a2zVideoAPI wiki!

This API supports video links to get video information like Embed Code, Video Thumb, Video Title, Video Description etc.

Some supported video sites:
http://www.youtube.com/watch?v=mXMf9GOzzOA
http://www.dailymotion.com/video/x5z91e_lets-play-holi_music
http://video.google.com/videoplay?docid=-7577046582869136330&hl=en
http://www.vimeo.com/9573920
http://www.metacafe.com/watch/4230785/ghetto_star_weekly_randy_radermacher/
http://blip.tv/file/3272712?utm_source=featured_ep&utm_medium=featured_ep
http://www.hulu.com/watch/131066/saturday-night-live-we-are-the-world-cold-open
http://www.viddler.com/explore/coop/videos/54/
http://www.5min.com/Video/How-to-Organize-Your-Life-219728873
http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=51722257
http://vodpod.com/watch/2492783-reactos-install-screencast-tutorial
http://www.ehow.com/video_4983481_change-ip-address-windows-vista.html
http://www.break.com/usercontent/2009/4/How-to-Run-Linux-on-Windows-Ubuntu-699185.html
http://www.atom.com/funny_videos/sw_gangsta_rap_chronicles/
http://www.funnyordie.com/videos/4d47a07835/danny-mendlow-the-solution-to-racism-and-the-biggest-issue-in-the-world
http://www.flickr.com/photos/traceytilson/3033319841/

How to use a2zVideoAPI:

1. Download “api.php” from http://github.com/svnlabs/a2zVideoAPI

2. API require PHP with CURL extension.. Setup / Upload “api.php” to your web server

3. Modify “api.php” for API Video server
curl_setopt($ch, CURLOPT_URL, ‘http://www.svnlabs.com/a2zvideoapi/server.php’);

4. There are currently 3 formats for API response

a. HTML
b. XML
c. JSON

$post = array( ‘url’ => “http://www.flickr.com/photos/schwartzray/2483697739/”, ‘format’ => “html” );

5. You have to use valid video page url like “http://www.youtube.com/watch?v=mXMf9GOzzOA” with format “html”, “xml” and “json”

6. Enjoy with svnlabs.com

Follow me….

Facebook: http://www.facebook.com/svnlabs
Twitter: http://www.twitter.com/svnlabs

Subscribe me….
Youtube: http://www.youtube.com/user/svnlabs
Feeds: http://blog.svnlabs.com/feed/

April
24

Hello Friends,

I read some where “Quality is not a product.. it is a process ;)

I think process is hard-work we do and product is final result we get.

But how we make our process to get a good product, as a LAMP developer I think track processes “Debug Log” is good sort of tool for monitoring programs.

Trouble shooting is quite simple with Log Files. Log file can be used with analysis tools, it’s possible to get a good idea of where errors are coming from, how often errors return.

Here you can see a simple PHP script to trace PHP programs…

debugLog.php
………………….

function debugLog($log, $text)
{
$log_dir = dirname($log);
if( !file_exists($log_dir) or !is_dir($log_dir) or !is_writable($log_dir) )
return false;

$write_mode = ‘w’;
if( file_exists($log) && is_file($log) && is_writable($log) )
$write_mode = ‘a’;

if( !$handle = fopen($log, $write_mode) )
return false;

if( fwrite($handle, $text. “\n”) == FALSE )
return false;

@fclose($handle);
}

Debugging Tools:

http://xdebug.org/
http://valgrind.org/
http://www.php-debugger.com/dbg/
http://pecl.php.net/package/apd
http://pear.php.net/package/Benchmark/
http://code.google.com/p/webgrind/

We can’t imagine processes without Log File ;)

April
23

PEAR have rich library to access web based resources easily…

<?php

$sv = new SVTube();
$sv->download(”D7cm-yu-CP0″, “svnlabs.flv”)

?>

Class: SVTube.php
——————————

<?php

require_once ‘HTTP/Client.php’;
require_once ‘HTTP/Request.php’;

class SVTube {

var $req;
var $debug = false;
var $auth = false;

function download ($video_id, $video_filename) {
$url = “http://www.youtube.com/watch?v=”.$video_id;
$this->req =& new HTTP_Request($url);
$response = $this->req->sendRequest();

if (PEAR::isError($response)) {
echo $response->getMessage().”\n”;
} else {
$page = $this->req->getResponseBody();

preg_match(’/\&t=([^"]*)”/si’, $page, $match);

$html=html_entity_decode(urldecode(str_replace(’\x’, ‘%’, $match[1])),ENT_QUOTES, “UTF-8″);

$echo = explode(”&”, $html);

$url = “http://www.youtube.com/get_video?el=detailpage&t=”.$echo[0].”&fmt=5&asv=3&video_id=”.$video_id;

if ($this->debug)
return $url.”\n”;

$req =& new HTTP_Request($url,array (”allowRedirects”=>true, “maxRedirects”=> 99));
$req->setMethod(HTTP_REQUEST_METHOD_GET);
$req->addHeader(”User-Agent”,”Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)”);
$response = $req->sendRequest();

$req->getResponseBody();

if (PEAR::isError($response)) {
//echo $response->getMessage().”\n”;
return “Error: Failed to open video file on YouTube\n”;
} else {
if ($o = fopen ($video_filename, “w”)) {
fwrite($o,$req->getResponseBody());
fclose ($o);
return “Download complete! File: “.$video_filename.”\n”;
} else {
return “Error: Failed to open video-file\n”;
}
}

}
}

}
?>

April
16

We can use PEAR to process zip files in PHP using Archive_Zip….

First set PEAR path in php include path using set_include_path

Make Zipped file

<?php
include (’Archive/Zip.php’);        // include PEAR ZIP package

$obj = new Archive_Zip(’test.zip’);  // zipped file name

$files = array(’svnlabs/1.gif’,
svnlabs/resume.doc’,
svnlabs/invoice.xls’);   // files add to zip

if ($obj->create($files)) {
echo ‘Files zipped successfully!’;
} else {
echo ‘Error in file zipping’;
}
?>
List Zip file elements

<?php
include (’Archive/Zip.php’);        // include PEAR ZIP package

$obj = new Archive_Zip(’test.zip’); // Input zip file

$files = $obj->listContent();       // zip information

foreach ($files as $f) {
foreach ($f as $s => $v) {
echo “$s: $v\r\n”;
}
echo “\r\n”;
}
?>
I really enjoyed programming with PEAR…

April
11

M3U is a computer file format that stores multimedia playlists.

<?php

function m3u_stream($dir) {

$mp3=”";
$siteurl=”http://www.domain.com/mp3/”;

$h1 = opendir($dir);

while ($file = readdir($h1))
{

if ($file == ‘.’ || $file == ‘..’) continue;
$mp3.=$siteurl.basename($dir).”/”.$file.”\r\n”;

}

closedir($h1);

return $mp3;

}

$folder = “svnlabs”;

file_put_contents($folder.”.m3u”, m3u_stream($_SERVER["DOCUMENT_ROOT"].”/mp3/”.$folder.”/”));

?>

Here “svnlabs” is a folder where all mp3 files exists… this program will create svnlabs.m3u playlist file using php script.

svnlabs.m3u file contents all mp3 links with domain “http://www.domain.com/mp3/”

svnlabs.m3u
………………

http://www.domain.com/mp3/svnlabs/1.mp3
http://www.domain.com/mp3/svnlabs/2.mp3
http://www.domain.com/mp3/svnlabs/3.mp3

……………………

Now http://www.domain.com/mp3/svnlabs.m3u can be used for streaming mp3 from www.domain.com

LimeExchange LimeExchange - Online Services Marketplace