Ok, this might sound like that we are in the spamming business now. Well, we are not. The case is that email address is typically the only per-person unique key in CRM data. These couple of lines of Python will extract email addresses from any text file, e.g a HTML-file. This script will also make list unique so if the same email address is listed many times in the original data, it will be only once in the output. Enjoy:
#!/usr/bin/env python # coding: utf-8 import os import re import sys def grab_email(file): """Try and grab all emails addresses found within a given file.""" email_pattern = re.compile(r'\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b', re.IGNORECASE) found = set() if os.path.isfile(file): for line in open(file, 'r'): found.update(email_pattern.findall(line)) for email_address in found: print email_address if __name__ == '__main__': grab_email(sys.argv[1])
import os import re import sys
def grab_email(file): """Try and grab all emails addresses found within a given file.""" email_pattern = re.compile(r'\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b', re.IGNORECASE) found = set() if os.path.isfile(file): for line in open(file, 'r'): found.update(email_pattern.findall(line)) for email_address in found: print email_address
if __name__ == '__main__': grab_email(sys.argv[1])
SugarCRM is nowadays very widely used CRM system so I will cover it in my posts every now and then.
The API is not very well documented but you can browse its capabilities be opening http://URL-TO-SUGAR/soap.php in your browser
At work we use it by ourselves to handle some processes and have been working with customers using it. There are things I like and thing I don’t like in SugarCRM. It is bit bloated and the code is not the most beautiful I have seen. On the other hand it does its job quite well and it is easy to configure without touching a line of code.
If you use a CRM in your business for a while you will most likely to find that you would like to do some integration. At work we have been doing various kinds of integration tasks. We have integrated a phone system to automatically make entries to SugarCRM when inbound or outbound calls have been made, connected registration of a web application to create a new accounts to CRM, connected a LIMS in various ways to it and so on. The reason I found SOAP-API to be the best way in most these cases is the fact that if you use it you won’t break down anything and it is likely that your code will work with future releases too. Off course there is a performance penalty and using SOAP API is not a good option when performance is an issue. So lets get to the business. Read the rest of this entry »
Today I was thinking about integrating our company’s SugarCRM with our Laconi.ca installation. I thought it would be cool, if our CRM could automatically tweet to Laconi.ca if e.g. a new case have been filed or mail has arrived to some of the group inboxes. There are several quite easy ways to do this. I began by logging into Sugar and looking around what data I would actually want to get out.
So as I clicked the Admin button and went to admin area I realized that there is a new version of SugarCRM available. Ok, I’ll install the new version first I thought hmm.. lets see release notes hmm.. a new feature Sugar Feeds, sounds cool. Maybe I could finally get Trac like timeline RSS feed from SugarCRM. Here is what release notes said:
Sugar Feed enables users to be informed as soon as a user creates a new contact, lead, opportunity, or case. Users can add a My Sugar Feed dashlet on their Home page so that when a user performs any of these actions, a message displays in the dashlet on their Home page. Userscan also be notified when a lead is converted, when a case is closed, and when an opportunity is closed. Additionally, users can post status updates, external links, images, and YouTube videos for other users to view within the dashlet. SugarCRM Community Edition5.2.2.3.h Release Notes
Sugar Feed enables users to be informed as soon as a user creates a new contact, lead, opportunity, or case. Users can add a My Sugar Feed dashlet on their Home page so that when a user performs any of these actions, a message displays in the dashlet on their Home page. Userscan also be notified when a lead is converted, when a case is closed, and when an opportunity is closed. Additionally, users can post status updates, external links, images, and YouTube videos for other users to view within the dashlet.
SugarCRM Community Edition5.2.2.3.h Release Notes
After reading that I still continued to believe that this would be like users life stream RSS-feed. Guess what, it was not. Sugar Feeds is SugarCRM’s internal message sending service. Sure it sounds kinda cute “aww, now I can send these nice little messages to my co-workers” but really. As long as there is no API and no RSS why would anyone log in to SugarCRM to read and write these messages.
As much as I do value the effort of the SugarCRM’s team and their bold moves on the open source field, I still cannot understand who would want to use Sugar Feeds.
“The average spam messages per day is 18.5 and the average time spent per day deleting them is 2.8 minutes. The loss in productivity is equivalent to $21.6 billion per year at average U.S. wages.” - Jesdanun, A. (2005), “Deleting spam costs billions, study finds”, The Associated Press Newswires (online)
“The average spam messages per day is 18.5 and the average time spent per day deleting them is 2.8 minutes. The loss in productivity is equivalent to $21.6 billion per year at average U.S. wages.”
- Jesdanun, A. (2005), “Deleting spam costs billions, study finds”, The Associated Press Newswires (online)
You can filter spam and viruses before they hit your mailserver
In my opinion the problem that is not solved yet is the deployment. I think every tech savvy person filters their spam already. But how about the rest of the people. Sure, you can use time and install a spam filter to each client, you can also install a spam filter to mail server and get more results.
If you wish to install spam filter to every client computer it will take lot of time and possibly people can mess up their installations. Updating lots of PCs does not sound like a good idea either.
Installing spam filter to a mail server sounds like a better idea but it might be that you cannot go to the mail server. Another problem would be that having a universal spam filter that works with any mail server is not reality.
But what about I you could just use hardware based solution that works out-of-the-box with any kind of setup. Wouldn’t that be cool? Perhaps the easiest way to eliminate spam in any POP3, IMAP & SMTP scenario would be to set up a network attached spam filter. This way would be 100% transparent to clients and completely platform independent. In SMTP scenario (You are not using mail server of your service provider, instead you have your own mail server) you can directly block spam before it goes to your mail server. You can also set up a simple shell script to automatically log in to your mail accounts and sweep the spam with Spamassassin. This would also be useful if you use a mobile device e.g. an iPhone to read your mail. Read the rest of this entry »
Full disk is a lousy reason to wake up in a middle of the night
In my last post I wrote about Laconi.ca and mentioned that we have many bots updating Laconi.ca too. The bots are made active when some condition has met.
Example: Make server running out of disk space to post an update to Laconi.ca
This is actually quite useful. Sure, you can tell every service to send an email when something not wanted is happening but then you will have to read that mailbox too. Sending email to someone else doesn’t solve the problem. Hmm, updating to Laconi.ca doesn’t solve the problem either but it makes servers easier follow and to subscribe.
So here is a simple shell script:
Read the rest of this entry »
Not familiar with Twitter?
Twitter is a free social networking and micro-blogging service that allows its users to send and read other users’ updates (otherwise known as tweets), which are text-based posts of up to 140 characters in length. Twitter page on Wikipedia
This post covers:
Laconi.ca in a browser & Twitterific
Ok, Twitter is sweet, even a bit addictive, but not that useful in internal use of your business for couple of reasons:
At first, Micro-blogging is like wiki in a way that it does not implement any kind of process. In Twitter the idea is “it’s a tool, use it as you like” This works well with Twitter.com, where all the users have their own reasons to use the service. In business however, the business has a goal and people are working to meet this goal for their common reason. Therefore a process, as loose as it might be, must be implemented. Read the rest of this entry »
You can get Ubuntu Cola from Sweden
One of my colleagues gave this drink to me on the other day so I had to post an image here.
Yesterday I had a simple problem. I had one big PDF-file with 6000 pages in it and I wanted to prepare it for mail house. What they needed to get the job done was two PDF-files, one with single-paged documents and one with multi-paged ones.
Luckily all the single-paged documents had string “Page: 1/1″ (or same in Finnish) on the top of the page. So writing a small Python-script to do the job was easy. What I needed in addition to Python was pdftotext binary (here is a dmg for OS X) and pyPdf. So here is the code: Read the rest of this entry »