<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -29,7 +29,7 @@ def shorten(url):
 def blurb(text, length, addDots=True, debug=False):
 	&quot;&quot;&quot;Reduces a text to length or less one word at a time, optionally adding...&quot;&quot;&quot;
 	if debug:
-		print &quot;Blurb |%s|&quot; % text
+		print &quot;Blurb |%s|&quot; % text.encode('ascii', 'replace')
 	if len(text) &lt;= length or len(text) == 0:
 		return text
 	else:
@@ -49,23 +49,23 @@ class Serializer(threading.Thread):
 		self.workRequestQueue = Queue.Queue()
 		self.resultQueue = Queue.Queue()
 		self.start()
-	
+
 	def apply(self, callable, *args, **kwds):
 		&quot;&quot;&quot;called by other threads as callable would be&quot;&quot;&quot;
 		self.workRequestQueue.put((callable, args, kwds))
 		return self.resultQueue.get()
-	
+
 	def run(self):
 		while 1:
 			callable, args, kwds = self.workRequestQueue.get()
 			self.resultQueue.put(callable(*args, **kwds))
-	
+
 
 class rss2twitter():
 	&quot;&quot;&quot;Takes a tuple of RSS feeds and twitter credentials and reads one, posts to the other.&quot;&quot;&quot;
-		
+
 	debug = False
-		
+
 	def __init__(self, username, password, feeds=None, cacheDir = './', tag=&quot;New %s post&quot;):
 		self.timers = []
 		self.twitQueue = Serializer()
@@ -85,13 +85,13 @@ class rss2twitter():
 				c.execute('create table if not exists &quot;%s&quot; (hash text primary key, date text)' % hashlib.sha1(f).hexdigest())
 		conn.commit()
 		c.close()
-	
+
 	def doDirectMessages(self, timerIndex):
 		&quot;&quot;&quot;Process Direct Messages, queue posts&quot;&quot;&quot;
 		self.timers[timerIndex]=threading.Timer(DIRECT_MESSAGE_DELAY, self.doDirectMessages, (timerIndex,))
 		self.timers[timerIndex].setName('DirectMessageTimer')
 		self.timers[timerIndex].start()
-	
+
 	def doRSSFeed(self, timerIndex, feedUrl):
 		&quot;&quot;&quot;Process RSS Feed, queue posts for new items&quot;&quot;&quot;
 		if self.debug is True:
@@ -113,21 +113,21 @@ class rss2twitter():
 				txtr = &quot;%s %s [%s]&quot;
 				txt  = (txtr % (txt, blurb(e.summary, POST_LENGTH - len((txtr % (txt, &quot;&quot;, link)).strip()), debug=True), link)).strip()
 				if self.debug:
-					print &quot;----\n%s&quot; % txt
+					print &quot;----\n%s&quot; % txt.encode('ascii', 'replace')
 					print &quot;Length %s&quot; % len(txt)
 				#self.postTweet(txt)
 				#threading.Thread(target=self.postTweet, name=&quot;postTweet-%s&quot;%hashlib.sha1(txt).hexdigest()[0:6], args=(txt,)).start()
 				if self.debug is True:
-					print &quot;Queueing tweet %s in thread %s.&quot; % (hashlib.sha1(txt).hexdigest()[0:6], threading.currentThread().getName())
+					print &quot;Queueing tweet %s in thread %s.&quot; % (hashlib.sha1(txt.encode('utf8')).hexdigest()[0:6], threading.currentThread().getName())
 				self.twitQueue.apply(self.postTweet, txt)
 		self.timers[timerIndex]=threading.Timer(RSS_FEED_DELAY, self.doRSSFeed, (timerIndex, feedUrl))
 		self.timers[timerIndex].setName(&quot;RSSFeedTimer-%s&quot; % timerIndex)
 		self.timers[timerIndex].start()
-	
+
 	def checkDirectMessages(self):
 		&quot;&quot;&quot;Check for new Direct Messages&quot;&quot;&quot;
 		pass
-	
+
 	def postTweet(self, msgText):
 		&quot;&quot;&quot;Post a Tweet&quot;&quot;&quot;
 		posted = False
@@ -155,17 +155,17 @@ class rss2twitter():
 					raise twitter.TwitterError(err.info().items()[0][1])
 			else:
 				if self.debug is True:
-					print &quot;Tweet %s posted in thread %s.&quot; % (hashlib.sha1(msgText).hexdigest()[0:6], threading.currentThread().getName())
+					print &quot;Tweet %s posted in thread %s.&quot; % (hashlib.sha1(msgText.encode('utf8')).hexdigest()[0:6], threading.currentThread().getName())
 				posted = True
-	
+
 	def sendDirectMessage(self, msgText):
 		&quot;&quot;&quot;Send a Direct Message&quot;&quot;&quot;
 		pass
-	
+
 	def deleteDirectMessage(self, msgID):
 		&quot;&quot;&quot;Delete a DirectMessage&quot;&quot;&quot;
 		pass
-	
+
 	def run(self, doDirect=False, debug=False):
 		&quot;&quot;&quot;Start processing everything&quot;&quot;&quot;
 		self.debug = debug
@@ -185,14 +185,14 @@ class rss2twitter():
 			if self.debug is True:
 				print &quot;Starting timer&quot;
 			t.start()
-	
+
 	def wasPublished(self, feedTable, feedEntry, storeHistory=True):
 		&quot;&quot;&quot;Checks to see if a feed item has been previously published&quot;&quot;&quot;
 		conn = sqlite3.connect(self.feedHistory)
 		c = conn.cursor()
-		entryVal = hashlib.sha1(feedEntry.summary).hexdigest()
+		entryVal = hashlib.sha1(feedEntry.summary.encode('utf8')).hexdigest()
 		if self.debug is True:
-			print &quot;checking %s for published status&quot; % feedEntry.title
+			print &quot;checking %s for published status&quot; % feedEntry.title.encode('ascii', 'replace')
 		c.execute('select date from &quot;%s&quot; where hash=?' % feedTable, (entryVal,))
 		if len(c.fetchall()) &gt; 0:
 			c.close()
@@ -210,11 +210,11 @@ class rss2twitter():
 				conn.commit()
 			c.close()
 			return False
-	
+
 	def printTimestamp(self, timerIndex):
 		&quot;&quot;&quot;pretty print's a timestamp, optionally the time specified&quot;&quot;&quot;
 		print &quot;Current Time: %s | Queue Size: %s&quot; % (time.asctime(), self.twitQueue.workRequestQueue.qsize())
 		self.timers[timerIndex]=threading.Timer(5, self.printTimestamp, (timerIndex,))
 		self.timers[timerIndex].setName(&quot;TimestampTimer-%s&quot; % timerIndex)
 		self.timers[timerIndex].start()
-	
+</diff>
      <filename>rss2twit.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6d41b4b6bc238fca058223e9361b36fb35f8823b</id>
    </parent>
  </parents>
  <author>
    <name>Derek Bruce</name>
    <email>dbruce@gmail.com</email>
  </author>
  <url>http://github.com/opie4624/pyrss2twitter/commit/e286ac8600c71a9e15c6e3c9bcf148ff1d81dd60</url>
  <id>e286ac8600c71a9e15c6e3c9bcf148ff1d81dd60</id>
  <committed-date>2008-09-03T01:30:51-07:00</committed-date>
  <authored-date>2008-09-03T01:30:51-07:00</authored-date>
  <message>Fixed utf8 with hashlib and made debug messages in ascii. Also removed unnecessary spaces.</message>
  <tree>342555305ae093444cd77ae9a85fe353c02020c9</tree>
  <committer>
    <name>Derek Bruce</name>
    <email>dbruce@gmail.com</email>
  </committer>
</commit>
