Archive for August, 2008
Curl Tutorial Part 2 Delayed & Survey Prize Increased
Part two of the CURL tutorial has been delayed until tomorrow due to time constraints. Sorry for the inconvenience. I’m going to write the next few parts tonight, so it’s all set to autopost.
The survey prizes have been changed! First prize is a $30 iTunes or Amazon gift Card. Second prize is a $10 gift card. Third prize is a $5 iTunes gift card. Three winners will be chosen on September 20th, so take the survey now
Metacafe Allows Visitors To Edit Metadata
I’m a little bit late writing about this, as it was reported on August 26th, but it blew my mind today. Metacafe has become the first video sharing website to open their titles, descriptions, and tags for editing by anyone - wiki style.
Simply click “Edit video details” above the video. A page will load allowing you to edit the video’s title, description, and tags. There’s also a history panel, showing all the revisions made to the video data. If there’s controversy over editing, there’s even a discussion panel similar to the Wikipedia “Discussion” tab. (Click links for screenshots.)
I think this is a great step for Metacafe, and I wish more websites would follow in their footsteps. A common trend across most video sharing websites is the large number of videos with false titles which can sometimes trick users into watching videos containing ads or other content (Rick Roll). Now that the entire community can edit the video data, this is bound to be a less frequent occurrence. I definitely hope to see other websites open their data for editing - if it works well for Metacafe, that is.
What websites do you think should open their content for editing? Post your ideas in the comments.
Code Snippit & Introduction To CURL
Update: I forgot that Wordpress messes with quotation marks. The code has been fixed and should work properly. (September 1st @ 5:39AM)
Thanks to Matt Lawrence for requesting this post! Email naresh@eNaresh.com if you have any questions for future posts.
CURL is a powerful way to interact with remote servers with PHP. With CURL, it is possible to download files from remote servers - which is what we’re going to do today.
So what exactly are we doing? We’re coding a simple CURL function that can be used over and over. This function is simply for getting the contents of files on remote servers. It doesn’t do anything fancy like submit forms - That’s for tomorrow.
Please read the comments (preceded by two back slashes) so you can learn from the code. The code is below, or you can view the .phps file.
<?
function fetchPage($location)
{
$curl = curl_init();
// The above line initializes the CURL session.curl_setopt($curl, CURLOPT_URL, $location);
// The above line tells CURL which URL we’re going to be fetching.
// $location is defined when you use the function.curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
// The above line tells CURL to save the file contents as a string.$result = curl_exec($curl);
// Pulls everything together and performs the CURL sessioncurl_close($curl);
// Frees all resources and ends the CURL session.return $result;
// returns the page contents when the function is complete.
}print fetchPage("http://eNaresh.com");
?>
Click here to view a demo of this code
If you execute this code, it’ll get the contents of this website and display it on your server. You can then use code to replace certain words, phrases, images, with str_replace and even scrape content.
Check back tomorrow afternoon for an introduction on submitting remote forms with CURL.
Software Pick - Debut Screen Recorder
Today’s software pick is a great screen recorder. In the past I’ve tried Hypercam, Camtasia and various other screen recorders, but have never been happy with them for various reasons.
Debut is the first freeware screen recorder that I’ve been impressed by. You can either record a webcam or desktop and save it in various formats with flexible encoding and compression options. Best of all, if you don’t have the proper encoder, Debut will download and install it for you automatically.
It has other great features such as the ability to upload the file to an FTP server, captions, and can also record audio at very high quality.
The downside? Debut adds a lot of items to your start menu. Not a big deal, but I don’t like clutter on my laptop.
Debut is for Windows only and is completely free. Download Now.
Win A $25 iTunes Or Amazon Gift Card
In an effort to learn what you, the readers, like to read about, I’ve setup a small reader survey at eNaresh.com/survey. As an incentive, a random entrant will win their choice of an iTunes or Amazon gift card.
The survey is very simple and takes less than 2 minutes. Please be as honest as possible - your answers won’t affect your chances of winning. The survey closes on September 21st at 9PM PST. The drawing will take place shortly after and a winner will be announced.
Click here to take the survey! Thanks for your participation.
Use Facebook Chat In Firefox Sidebar
Do you like the idea of Facebook chat, but never remember to leave facebook open all day? I may have a solution for you if you use Firefox.
Simply bookmark the Facebook Chat Popout. Then, right click the “Facebook Chat” bookmark and select “Properties”. Click the check box labeled “Load this bookmark in the sidebar”. Click the bookmark and Facebook chat will open in your Firefox sidebar.
Have a social network tip to share? Send an email to naresh@eNaresh.com and you’ll get credit in future posts.
uStreaming All Day
I’m streaming all day over at uStream.tv. Feel free to stop by and hang out or ask any coding or web development questions you have in the chatroom.
Also, thanks to everyone who subscribed to the RSS feed or subscribed by email to the right. The number of subscribers went up by about 30 overnight. It’s much appreciated.
Halo Wars Looks Amazing
I was over at my neighbors apartment yesterday playing getting my ass handed to me on Gears Of War. When we got tired of me losing miserably, he pulled up the trailer for “Halo Wars”, and I’m very impressed.
I’m not into video games very much. In fact, I’ve never owned a game system aside from a Game Boy. Yeah, it’s a tough life. However, I was addicted to cocaine Starcraft for a few months, and Halo Wars seems to have the same type of gameplay.
I’ve added the trailer to the end of this post. You can also download the HD version on your xbox.
If you have any thoughts about this game, please sound off in the comments. Any Gears of War tips would be amazing as well.
FireFox Plugin Of The Week: Dr. Web Antivirus
This week’s FireFox plugin is called Dr. Web. This plugin allows you to easily scan a file or web page for viruses before you download them. Simply right click a link, select “Scan with Dr. Web”, and wait a moment. In a few seconds you’ll know if you should steer clear of the file, or if it’s safe to download.
This plugin allows you to check any file you are about to download, any page you are about to visit with online version of Dr.Web anti-virus!
New menu item “Scan with Dr.Web” will appear on hyperlink context menu.
Dr. Web has a 4 star rating at addons.mozilla.org
Thanks For The Theme, Mark!
A big “Thank You” goes out to Mark Cole (Twitter) for the amazing new theme! I’ve never been happy with the way eNaresh has looked, but this design definitely does the job.
I should be posting much more frequently, so you might consider subscribing to the RSS Feed to keep track of the updates. You can also get updates in your email inbox by entering your email address to the right.
Mark may be available for freelance work and can be reached either by emailing mark {at} mark-cole.net or visit Mark-Cole.net. Brady Valentino helped with this design and may be available for freelance as well.




