Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Python: How to use urllib2 with basic HTTP authentication

import urllib2
prog_URL = urllib2.HTTPPasswordMgrWithDefaultRealm( )
prog_URL.add_password(None, 'http://premium.tubedir.com/', 'username',
    'pa

Java-JavaMail: Create and send message in HTML format

import java.io.*;
import java.util.Properties;
import java.util.Date;
import javax.mail.*;
import javax.activation.*;
import javax.mail.internet.*;
i

Perl: Counting Lines in a File

$file="c:/index.html";
open(FILE, ";
print "$file contains ",$count," lines";

Perl: How to connect to an FTP server and transfer files

#!/usr/bin/perl
use warnings;
use strict;
use Net::FTP;
my $ftp = Net::FTP->new("ftp.monserveurFTP.com", Timeout => 60)
		or die "Couldn't connect:e: