# Uber thanks to http://www.xml.com/lpt/a/2002/12/18/dive...
from xml.dom import minidom
import urllib
import sys
DEFAULT_NAMESPACES = \
(None, # RSS 0.91, 0.92, 0.93, 0.94, 2.0
'http://purl.org/rss/1.0/', # RSS 1.0
'http://my.netscape.com/rdf/simple/0.9/' # RSS 0.90
)
def load(rssURL):
return minidom.parse(urllib.urlopen(rssURL))
def getElementsByTagName(node, tagName):
children = node.getElementsByTagName(tagName)
if len(children): return children
return []
def first(node, tagName):
children = getElementsByTagName(node, tagName)
return len(children) and children[0] or None
def textOf(node):
return node and "".join([child.data for child in node.childNodes]) or ""
if __name__ == '__main__':
# rssDocument = load('http://www.malevolentwhispers.org/index....')
rssDocument = load(sys.argv[1]);
fileObj = open(sys.argv[2],"w");
for item in getElementsByTagName(rssDocument, 'item'):
fileObj.write( "#POST\n" );
fileObj.write( textOf(first(item,'category')) + "~\n" )
fileObj.write( textOf(first(item,'title')) + "~\n" );
fileObj.write( textOf(first(item,'author')) + "~\n" );
fileObj.write( textOf(first(item,'link')) + "~\n" );
fileObj.write( textOf(first(item,'feedburner:origLink')) + "~\n" );
fileObj.write( "#END\n" );
fileObj.close();
def load(rssURL):
return minidom.parse(urllib.urlopen(rssURL))
# Uber thanks to http://www.xml.com/lpt/a/2002/12/18/dive...
from xml.dom import minidom
import httplib, urllib
import sys
DEFAULT_NAMESPACES = \
(None, # RSS 0.91, 0.92, 0.93, 0.94, 2.0
'http://purl.org/rss/1.0/', # RSS 1.0
'http://my.netscape.com/rdf/simple/0.9/' # RSS 0.90
)
def load(rssURL):
conn = httplib.HTTPConnection("www.malevolentwhispers.org")
cookies = {'Cookie': 'qsf_user=xxx;qsf_pass=xxx'}
conn.request("GET", "/index.php", urllib.urlencode({'a': 'index.php'}), cookies)
r1 = conn.getresponse()
# might want to worry a little if r1.status isn't 200 (i.e. OK)
data = r1.read()
return minidom.parse(data)
def getElementsByTagName(node, tagName):
children = node.getElementsByTagName(tagName)
if len(children): return children
return []
def first(node, tagName):
children = getElementsByTagName(node, tagName)
return len(children) and children[0] or None
def textOf(node):
return node and "".join([child.data for child in node.childNodes]) or ""
if __name__ == '__main__':
# rssDocument = load('http://www.malevolentwhispers.org/index....')
rssDocument = load(sys.argv[1]);
fileObj = open(sys.argv[2],"w");
for item in getElementsByTagName(rssDocument, 'item'):
fileObj.write( "#POST\n" );
fileObj.write( textOf(first(item,'category')) + "~\n" )
fileObj.write( textOf(first(item,'title')) + "~\n" );
fileObj.write( textOf(first(item,'author')) + "~\n" );
fileObj.write( textOf(first(item,'link')) + "~\n" );
fileObj.write( textOf(first(item,'feedburner:origLink')) + "~\n" );
fileObj.write( "#END\n" );
fileObj.close();
$ curl -v "www.malevolentwhispers.org/index.php?a=r..."
* About to connect() to www.malevolentwhispers.org port 80 (#0)
* Trying 66.218.49.113… connected
* Connected to www.malevolentwhispers.org (66.218.49.113) port 80 (#0)
> GET /index.php?a=rssfeed HTTP/1.1
> User-Agent: curl/7.16.1 (i386-pc-solaris2.10) libcurl/7.16.1 OpenSSL/0.9.7g zlib/1.2.3
> Host: www.malevolentwhispers.org
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Wed, 21 Jan 2009 22:15:37 GMT
< Server: Apache/2.2.10 (Fedora)
< X-Powered-By: PHP/5.2.6
< P3P: CP="CAO PSA OUR"
< Set-Cookie: PHPSESSID=ticn3bl3ijd0q9j5rn6t8abl55; path=/
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< Set-Cookie: qsf_lastallread=1232489737; expires=Thu, 21-Jan-2010 22:15:37 GMT; path=/; domain=www.malevolentwhispers.org; httponly
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: text/xml
(file follows)
That's what I see in GDB. Talk about a screenfull. It's a bit daunting honestly.
So then I:
Now, that's not entirely right. For this particular entry, name should be MWForums:
Of course this further peaks my curiousity.
Huh. That's odd. Wth is up with that? I dunno. And that's where all of you come in. Maybe you'll see something I'm not. Maybe Kiasyn will happen along and just know what went wrong. I put all the code for the bot in here. And I'm using SmaugFUSS 1.9 as a base for my code, And yeah… I haven't a fucking clue here guys..
Oh, my DISPOSE macro:
Hmm. That should be everything…