titbits from the world less travelled

Archive for January, 2009

SilkTest: Extension problems while using IE and FireFox.

One thing you must know is that even though you can use the latest browsers to surf the net and so on so forth, you cannot use it to test using the SilkTest tool. This really sucks. Many a time, I tried using the latest versions of firefox and ie to test, but simply was left with a command line instead of browser test framework. First of all to start testing, if you are using Silktest 2008, try using Mozilla 2.0 and IE 7.IE sucks so lets go with firefox 2.0. The two places where you will have to set the extensions are for silktest to recognize the browser are:

1) start-> All Programs-> Borland-> Silktest-> Extension Enabler.

If you dont set this there might be problems in running you tests. This is the global settings for Silktest.

2) Project specific settings-> Select a project. Goto options->Extensions in the silktest windows. In the ensuing window select the extensions you would like to enable. These settings are for the project specific ones. Any questions send me a message. Goodluck.

posted by admin in Uncategorized and have Comments (3)

Greasemonkey user installation errors

Recently started to learn about grease monkey. For newbies grease monkey in my words, is a way to alter any webpages for your own purposes on the client side.

My first installation of user scripts started pretty bad. I couldnt figure out why I was getting the below error. Something like cannot launch editor: [Exception: component returned failure code]

After much ado, I realized the way, I was trying to install a user script was wrong. My mistake was to goto Tools: Grease Monkey: New User SCript.

I was trying to create a new user script rather than install one. So the editor was failing and calling an exception..

The easiest way to install a user script would to open up the user script in firefox, and then firefox prompts to install the user script at the top.

posted by admin in grease monkey and have No Comments

using feedparser to read atom/rss feeds in python

I just wrote this small code snippet to read a rss/xml/atom using the feedparser library. Hope you might find it useful. I read from the XML, which is my feed and then write to file which represents a SQL query for easy insertion into a DB>

import feedparser
d = feedparser.parse(“blog.xml”)
print d['feed']['title']
total_len = len(d['entries'])

val = 0
filehandle = open(‘test.html’,'w’)
filehandle.write(‘INSERT INTO `wp_posts` (`ID`, `post_author`, `post_date`,’+
‘`post_date_gmt`, `post_content`, `post_title`, `post_category`’+
‘, `post_excerpt`, `post_status`, `comment_status`, `ping_status`,’+
‘`post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`,’+
‘`post_modified_gmt`, `post_content_filtered`, `post_parent`, `guid`,’+
‘`menu_order`, `post_type`, `post_mime_type`, `comment_count`) VALUES’)
for val in range(48, total_len):
filehandle.write(“(“)

filehandle.write(str(val))
filehandle.write(“, 1, ‘2009-06-03 17:11:58′, ‘2009-06-03 17:11:8′,’”)
e = d.entries[val]
content = e.content[0].value
encoding = “ascii”
out = content.encode(encoding, “ignore”)
#print content
filehandle.write(str(content))
var_1 = “‘,’”
filehandle.write(var_1)
filehandle.write(d.entries[val].title)
filehandle.write(“‘, 0, ”, ‘publish’, ‘open’, ‘open’, ”,”)
filehandle.write(“‘blogger’, ”, ”, ‘2009-06-03 17:11:58′,”)
filehandle.write(“‘2009-06-03 17:11:58′, ”, 0,”)
filehandle.write(“‘http://kmdarshan.com/wordpress/?p=”)
filehandle.write(str(val))
filehandle.write(“‘, 0, ‘post’, ”, 0),”)

posted by admin in file handling, python, rss xml and have No Comments