<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -141,26 +141,29 @@ class html:
 		if ctype.startswith('audio/'):
 			return &quot;eu n&#227;o tenho ouvidos, seu insens&#237;vel!&quot;
 
-		title_pattern = re.compile(r&quot;&lt;[Tt][Ii][Tt][Ll][Ee][^&gt;]*?&gt;(.*?)&lt;/[Tt][Ii][Tt][Ll][Ee]&gt;&quot;, re.UNICODE|re.MULTILINE|re.DOTALL)
-		data = ''
-		while True:
-			if len(data) &gt; DATA_LIMIT:
-				break
-
-			d = self.urlObj.read(DATA_CHUNK)
-			if not d:
-				break
-
-			data += d
-
-			title_search = title_pattern.search(data)
-			if title_search is not None:
-				title = title_search.group(1)
-				title = title.strip().replace(&quot;\n&quot;,&quot; &quot;).replace(&quot;\r&quot;, &quot; &quot;)
-				title = re.sub(&quot;&amp;#?\w+;&quot;, &quot;&quot;, title)
-				return &quot;[ %s ]&quot; % (title)
-
-		return None
+		if 'html' in ctype or 'xml' in ctype:
+			title_pattern = re.compile(r&quot;&lt;title[^&gt;]*?&gt;(.*?)&lt; */ *title *&gt;&quot;, re.UNICODE|re.MULTILINE|re.DOTALL|re.IGNORECASE)
+			data = ''
+			while True:
+				if len(data) &gt; DATA_LIMIT:
+					break
+
+				d = self.urlObj.read(DATA_CHUNK)
+				if not d:
+					break
+
+				data += d
+
+				title_search = title_pattern.search(data)
+				if title_search is not None:
+					title = title_search.group(1)
+					title = title.strip().replace(&quot;\n&quot;,&quot; &quot;).replace(&quot;\r&quot;, &quot; &quot;)
+					title = re.sub(&quot;&amp;#?\w+;&quot;, &quot;&quot;, title)
+					return &quot;[ %s ]&quot; % (title)
+			# no title found
+			return None
+
+		return &quot;%s? o que &#233; isso?&quot; % (ctype)
 
 
 password = sys.argv[1]</diff>
      <filename>bot_sql.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9dfc3423627ee950c30c87e9dfad20ed46628ca5</id>
    </parent>
  </parents>
  <author>
    <name>Eduardo Habkost</name>
    <email>ehabkost@raisama.net</email>
  </author>
  <url>http://github.com/ehabkost/PythonBot/commit/92573b90ab18eaf4821dd2222de48f765cfb0336</url>
  <id>92573b90ab18eaf4821dd2222de48f765cfb0336</id>
  <committed-date>2009-11-03T10:02:50-08:00</committed-date>
  <authored-date>2009-11-03T10:02:50-08:00</authored-date>
  <message>look for &lt;title&gt; only on html or xml documents

Signed-off-by: Eduardo Habkost &lt;ehabkost@raisama.net&gt;</message>
  <tree>39ca26db7fe3a37de770303b4fbd1c580768f7e8</tree>
  <committer>
    <name>Eduardo Habkost</name>
    <email>ehabkost@raisama.net</email>
  </committer>
</commit>
