July 29, 2011
July 23, 2011
Blogger visitors stats [ incomplete ]
I am going to let guys try it too. Here it is : http://djurva.info.ru.com/stats/ It collects user data like refere,ip,useragent,time of visit etc and displays them to site admin. You can see the implementation on left sidebar of this blog.
How does it work ? You embed the image on a target page and it keeps collecting data for you to analyze. ( that simple )
The script is in alpha phase only so bug reports are welcomed.
Do comment if you try it. :)
July 08, 2011
Songs.pk grabber [ Updated on 7.7.11 ]
A minor change was brought in regexp of function extract_songs(); :P
Read about the previous version of this script here: http://technoslab.blogspot.com/2011/03/songspk-grabber.html
Demo (provided by a user in a comment below)
mp3.playvm.com/
Download: Songs_pk_grabber_with_tagedit.rar (rar/346kb)
Please register/then login on the forum to download the script.
July 01, 2011
PHP - lame encoder mp3 conversion
You can change album,artist,trackno,genre,year,comment,artist,art and bitrate.
Link to lame encoder : Click here
Enjoy guys !
May 29, 2011
Multiple file upload - like cPanel
Features :
- Public mode.
- Private mode ( secured by password )
- Multiple file uploads simultaneously.
- Secured file uploads.
- Easy to customize and use.
May 15, 2011
PHP video conversion script - updated on Jan 2012
** THIS PROJECT HAS BEEN DISCONTINUED **
Video workshop 2.3 - screenshots |
Video workshop - v2.3
( updated on January 2012 )
This is a video conversion PHP script created by me. It uses mencoder/ffmpeg for encoding videos from one format to another.
Supported extensions :
- Flv
- Avi
- 3gp
- Mov
- Mp4
- Mp3
Features:
- Direct upload videos or fetch a URL and upload to server.
- Convert videos to other supported formats.
- Convert video to audio.
- Watermark videos.
- Generate screenshots of a video at specified position ( in seconds).
- View conversion command and logs.
- Simple authentication - Login / Logout mechanism.
- Extend the script to add more formats by editing configs and optionally adding CLI commands.
The script is best suited for video based sites hosted on a VPS / dedicated server.
Installation : Follow readme.txt and then upload all files to your webhost.
May 08, 2011
PHP function to edit mp3 tags
It makes use of getid3 so make sure that it's available in same folder.
May 01, 2011
Selecting every checkbox on current page - Javascript
April 29, 2011
Get technical specifications of all mobiles available so far
It will allow you to view technical specifications of every cellphone available in the market.
If you like the specifications, please view the original website for more ( Links available in the footer on that page )
This plugin was coded by me. Enjoy !!
You can access it from here : http://technoslab.blogspot.com/p/spec-o-scope.html
A link to that page has also been attached to the navigation menu.
April 28, 2011
Video watermarking using PHP and Mencoder
Like any other guy, I firstly thought about using ffmpeg. My search for video watermarking using ffmpeg landed me to pages that talked about vhook module but unfortunately, newer versions of ffmpeg didn't had support for vhook and the video filters that had to replace vhook were/are still under development. ( see here )
My next move was to search for an alternative. I looked for CLI based tools like mencoder and even considered using wine ( bad idea though. ). After lots of research and googling, I finally figured out that mencoder could be used to add subtitles to vidoes and that was it.
I made myself a quickly subtitles file and named it watermark.srt, grabbed a font from my fonts dir and a video file.
I used following command to watermark the video
CLI code :
Watch closely. -sub option defines the subtitile file to be used, -font option defines the font file to be used and -subpos defines the position of subtitles file. Rest of the options are for video format and output file name. In this code, we are converting a_samp.avi to b_samp.avi and while doing so, we are copying audio stream as it is but altering video stream using -ovc option. We're also applying subtitles file on the video using verdana font. Note that watermark.srt and verdana.ttf files must be present in current directory. ( Or specify their absolute path )
( Read more on mencoder options. ) You can get more info about srt files here.
Sample srt file :
00:00:1,000 --> 00:00:20,000
Text1
2
00:00:21,000 --> 00:20:30,000
Text2
Explanation :
The srt file simply tells the player to display Text1 between 1 to 20 seconds and Text2 between 21 to 30 seconds and you can easily get a font. Use clear and simple fonts like verdana,arial etc
How to do this in PHP ?
Call a function to execute the command. Eg.shell_exec();exec();system();passthru();
Output :
Fig: Video after watermarking. |
Links :
[1]. Download Mplayer / Mencoder
[2]. Mencoder documentation
[3]. Mencoder on wikipedia
April 17, 2011
Nth thumbnail generation using PHP
This script generates thumbnail of nokia theme files (.nth) using PHP. It's ideal for wap / web portals that server nokia themes to it's users.
These theme files are simple compressed archive with theme info enclosed in a xml file named 'theme_descriptor.xml'
Follow comment to get an idea of what the script does on each step.
April 14, 2011
Upload videos to youtube.com via PHP script
A sample script that uploads a specified video to youtube.com under your account.
Setup and obtain API details.
Setup the script and execute it.
April 13, 2011
Posting to blogger.com via PHP
Fill in the credentials, execute the script and the post will appear immediately on your blog.
Download the required file: http://framework.zend.com/download/gdata
April 07, 2011
TOP 5 hosts for your project.
There are many websites which give you the platform for hosting your project codes online. I thought it would be nice to share a list with you.
#1. GoogleCode
The best place to keep your code is to put on the most trusted internet brand. Google Code not only hosts your code source but also provides various resources to you. Here you can find API and toolkits for various streams including the open source programs. It has a feature called code playground where, live online coding can be done and output can be seen. Google code is good platform for developers and for project hosting.
#2. Sourceforge
An open source code hosting site, here you can easily upload your code and downloads other code of your interest. The most popular code hosting site has suffered from many problem too. It is good site for getting open source software code. There is a high number of downloads of code through it daily.
#3. Codeplex
The codeplex is hosted by Microsoft but is not under it control. This is also a legitimate site for hosting your code. It is best when came for the .net projects. You can create, search,modify,download and uploads various projects here with simplicity. It too is an open source web host. The rawr is one of it best feature.
#4. Github
The Github provides the option of hosting the code as public or private. They took $7 per month for the private hosting. It supports for the multiple team management make it more versatile. Here you will able to plan your code and price it as well.
#5. Launchpad
The Launchpad is developed and maintained by the same company which supports Ubuntu Canonical Ltd. This as is open source and code hosting is done by so-called Bazaar. Answer tracking and mailing list helps the member interaction. It too supports for the translation as well.
Try out these sites which host code and do drop in your comments if you have more services to add to the list.
April 05, 2011
- For multiple Tables, table names must be comma separated value.
- For all tables, use "*" in place of table name.
- Prevent the script from timing out / running out of memory in case your database is huge.
March 08, 2011
Extremely simple jQuery tooltip
Here's a very simple jQuery tooltip which converts title of a link to tooltip.
- Converts all link's title to tooltip.
- Very easy to implement.
- Tooltip can have images / icon as well.
- Easy to customize and alter looks using css.
Include jQuery in your pages :
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
Now, define the tooltip as follows :
<script>
function d(x){
return document.getElementById(x);
}
function implementtt(){
links = document.getElementsByTagName('a');
num = links.length;
for(i=0;i<num;i++){
elem = links[i];
if(elem.getAttribute('title')==null || elem.getAttribute('title')==''){
}
else{
title = elem.getAttribute('title');
elem.setAttribute('onmouseover','tt(this,"'+title+'")');
elem.removeAttribute('title');
}
}
}
window.onload=function(){implementtt();}
function tt(x,y){
$('#tt').show();
$('#tt').html(y);
$(x).mousemove(function(e){
Px = e.pageX;
Py = e.pageY;
d('tt').setAttribute('style','position:absolute;top:'+Py+';left:'+Px+';');
});
$(x).hover(function(){},function(){$('#tt').hide();})
}
</script>
add some style to your tooltip : ( used some css3 )
<style>
#tt{
position:absolute;
background:rgb(50,50,50);
color:rgb(255,255,255);
opacity:0.8;
-moz-border-radius:5px 0px 5px 0px;-webkit-border-top-right-radius:5px 0px 5px 0px;-khtml-border-radius:5px 0px 5px 0px;
padding:5px;
margin-top:15px;
margin-left:15px;
font:9px verdana;
z-index:99;
}
</style>
and finally, add the tooltip container to your page :
<span id='tt'style='display:none;'></span>
and there you go. All the link title(s) of your page would be transformed into a beautiful,easy to customize tooltip. You can add images and more..
Click here for demo
March 07, 2011
PHP - Mysql sanitizer function
Hope you like it.
March 06, 2011
FFmpeg class - Generate video screenshot using PHP
Usage :
- First param is video path.
- Second param is the number of screenshots to be taken.
- Third param is the path to ffmpeg executable.
- The script must have execute permission.
- You should have a directory named thumbs with write permission.
- You can watermark the resulting image and merge then all to get a single screenshot.
Download : ( code hosted at pastebin.com )
March 05, 2011
PHP visitor counter script [ no SQL - flatfile based ]
- Doesn't require a database for storage / uses text file.
- Very easy to implement and use.
Download
March 03, 2011
Songs.pk grabber ( Grab and serve all Bollywood songs from your site now )
I've coded a nice little songs.pk grabber and I want to share it with you all :
Click here for online demo
It can boost you traffic because all famous bollywood songs would be directly available on you site.
Features list :
- Serve direct links from songs.pk
- Transfer the mp3 to your server and then serve it.
- Transfer the mp3 to your server, alter / remove meta data of audio files ( tags like album artist, comments etc ) and the serve it.
- Completely CSS based template for easy modification and customization of looks.