Monday, September 7, 2009

Installing xmpppy in Windows

This article is moved to my new blog site. You will find this in this link: http://www.sakibiqbal.com/blog/installing-xmpppy-windows

Sending Google Talk IM using python


Google talk uses XMPP protocol for sending/receving IM. Any client that supports Jabber/XMPP can connect to the Google Talk service. The service is hosted at talk.google.com on port 5222, TLS is required for Google Talk and The only supported authentication mechanism is SASL PLAIN. This are very important thing to know before coding for Google Talk.


In Python for XMPP support, I have used xmpppy. First download and install it in your system, detail is here. After that you need to connect, authonticate and send the IM. This is really as simple as that. The sample code I have used to perform the job is this:
  • import xmpp
  • import time 
  • jid  =  xmpp.protocol.JID( 'your.gmail.id@gmail.com' )
  • cl  =  xmpp.Client('gmail.com')
  • cl.connect( ( 'talk.google.com', 5223 ) )
  • cl.auth( jid.getNode( ), 'your_gmail_password' )
  • IM = 'sending for testing'
  • cl.send( xmpp.protocol.Message( 'friends.gmail.id@gmail.com', IM,typ = "chat" ) )
  • time.sleep( 1 )
  • print str( IM ) + ' sent '
This is how you can send IM to a Google Talk friend using Python.

Thanks
 Sakib

Sunday, September 6, 2009

Swine flu! The Symptoms

It is important that as swine flu spreads, you know the symptoms of the disease so you can recognize it in yourself and others at an early stage.

So far, most swine flu cases have been mild, with symptoms similar to those of seasonal flu. Only a small number of people have had more serious symptoms.

If you or a member of your family has any of the following symptoms and a temperature of 38°C or above, you may have swine flu.

The typical symptoms are:
     * a sudden fever (a high body temperature of 38°C/100.4°F or above), and
     * a sudden cough.

Other symptoms may include:
     * headache,
     * tiredness,
     * chills,
     * aching muscles,
     * limb or joint pain,
     * diarrhoea or stomach upset,
     * sore throat,
     * runny nose,
     * sneezing, or
     * loss of appetite.

If you discover those symptoms in you, please visit hospital to test, whether it is seine flu or not.

Remember, Swine flu is not dangerous if the patient take proper treatment in time.

Find swine flu threats in google map in here.

Thanks,
Sakib

Plone 2.x to Plone 3.x upgrade







Recently I am working on plone 2 to plone 3 upgrading. The following codes I think is commonly used in many cases, that need to be change as following:

Old

New

from Products.CMFCore.CMFCorePermissions import AddPortalContent

try:
from Products.CMFCore.permissions import AddPortalContent
except ImportError:
from Products.CMFCore.CMFCorePermissions import AddPortalContent

from Products.AddRemoveWidget.ComboBoxWidget import ComboBoxWidget

from Products.Archetypes.Widget import SelectionWidget

import Products.CMFCore import CMFCorePermissions

try: # New CMF
from Products.CMFCore import permissions as CMFCorePermissions
except ImportError: # Old CMF
from Products.CMFCore import CMFCorePermissions


All text ComboBoxWidget

Converted into SelectionWidget

import Products.CMFCore.CMFCorePermissions as CMFCorePermissions

try: # New CMF
from Products.CMFCore import permissions as CMFCorePermissions
except ImportError: # Old CMF
from Products.CMFCore import CMFCorePermissions


from Products.CMFCore.CMFCorePermissions import setDefaultRoles


try: # New CMF

from Products.CMFCore.permissions import setDefaultRoles

except ImportError: # Old CMF


from Products.CMFCore.CMFCorePermissions import setDefaultRoles


I am expecting your contribution to add more like this type of changes during plone 2 to plone 3 upgrade.

Thanks,
Sakib

Nokia Built in IM setting for Yahoo!


Now Yahoo got support for Nokia built in IM. You can now configure your Nokia built in IM for yahoo. To make it work, set the IM configuration as bellow:



1. Server Name: Yahoo! or any preferred name.
2. Access Point in use: Your desired access point that use IM to access internet.
3. Web address: imps.msg.yahoo.com
4. User ID: your yahoo user name
5. Password: your yahoo account password

All the fields are necessary to fill up correctly. I have tested built in IM with my Nokia E71, works pretty fine.

Thanks.