<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How To Get RSS Content Into An Sqlite Database With Python &#8211; Fast</title>
	<atom:link href="http://www.halotis.com/2009/07/07/how-to-get-rss-content-into-an-sqlite-database-with-python-fast/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.halotis.com/2009/07/07/how-to-get-rss-content-into-an-sqlite-database-with-python-fast/</link>
	<description>Entrepreneurship in the 21st Centruy</description>
	<lastBuildDate>Sat, 21 Jan 2012 09:19:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: uttecttirty</title>
		<link>http://www.halotis.com/2009/07/07/how-to-get-rss-content-into-an-sqlite-database-with-python-fast/comment-page-1/#comment-17646</link>
		<dc:creator>uttecttirty</dc:creator>
		<pubDate>Wed, 13 Apr 2011 10:47:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.halotis.com/?p=469#comment-17646</guid>
		<description>When, as an  organiser , or DJ   , taking into account the audiovisual  lease , there are several   Visual complement to the audio equipment for the Dance Party that can be used to enhance the experience of  players and  create a lot more success. It is important to consider these audio-visual equipment Rental  meliorations,  specially in relation to rental   of audio and video equipment. Rental of video equipment is not  inexpensive, and you need to  determine  meaning   and  apologize  the cost per  opus  added  Ab rental equipment. 

Of course, &lt;a href=&quot;http://www.avplanetrentals.com/&quot; / rel=&quot;nofollow&quot;&gt;audio visual rentals&lt;/a&gt; component    Ab systems is of  predominate  importance  .  Notwithstanding, when you add a simple, unexpected, powerful  , and emotions better visuals, your  saltations will  lift  to a new  storey . 

What are the Visual effects are  in that location to add to your installation   ball? We  pursue the laser    clarification , pin location lighting, black lights  ,  light sources flash, mirror  musket balls,  reflecting telescopes, projection screens and projectors for rent, as well as to  insert  more modern set of  extended lighting  stripteases ,  passed  lightin.</description>
		<content:encoded><![CDATA[<p>When, as an  organiser , or DJ   , taking into account the audiovisual  lease , there are several   Visual complement to the audio equipment for the Dance Party that can be used to enhance the experience of  players and  create a lot more success. It is important to consider these audio-visual equipment Rental  meliorations,  specially in relation to rental   of audio and video equipment. Rental of video equipment is not  inexpensive, and you need to  determine  meaning   and  apologize  the cost per  opus  added  Ab rental equipment. </p>
<p>Of course, <a href="http://www.avplanetrentals.com/" / rel="nofollow">audio visual rentals</a> component    Ab systems is of  predominate  importance  .  Notwithstanding, when you add a simple, unexpected, powerful  , and emotions better visuals, your  saltations will  lift  to a new  storey . </p>
<p>What are the Visual effects are  in that location to add to your installation   ball? We  pursue the laser    clarification , pin location lighting, black lights  ,  light sources flash, mirror  musket balls,  reflecting telescopes, projection screens and projectors for rent, as well as to  insert  more modern set of  extended lighting  stripteases ,  passed  lightin.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Storing RSS feeds into a Sqlite database &#171; Wheatland Computing</title>
		<link>http://www.halotis.com/2009/07/07/how-to-get-rss-content-into-an-sqlite-database-with-python-fast/comment-page-1/#comment-17288</link>
		<dc:creator>Storing RSS feeds into a Sqlite database &#171; Wheatland Computing</dc:creator>
		<pubDate>Tue, 18 May 2010 06:40:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.halotis.com/?p=469#comment-17288</guid>
		<description>[...] How To Get RSS Content Into An Sqlite Database With Python – Fast [...]</description>
		<content:encoded><![CDATA[<p>[...] How To Get RSS Content Into An Sqlite Database With Python – Fast [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Boschmans Account &#187; Blog Archive &#187; Using threads in Python</title>
		<link>http://www.halotis.com/2009/07/07/how-to-get-rss-content-into-an-sqlite-database-with-python-fast/comment-page-1/#comment-17244</link>
		<dc:creator>The Boschmans Account &#187; Blog Archive &#187; Using threads in Python</dc:creator>
		<pubDate>Tue, 26 Jan 2010 22:18:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.halotis.com/?p=469#comment-17244</guid>
		<description>[...] the blog post from Halotis that started my looking into [...]</description>
		<content:encoded><![CDATA[<p>[...] the blog post from Halotis that started my looking into [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Warren</title>
		<link>http://www.halotis.com/2009/07/07/how-to-get-rss-content-into-an-sqlite-database-with-python-fast/comment-page-1/#comment-16275</link>
		<dc:creator>Matt Warren</dc:creator>
		<pubDate>Tue, 15 Sep 2009 04:07:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.halotis.com/?p=469#comment-16275</guid>
		<description>for mySQL - if you take the code in the comments that uses sqlalchemy, then you can just change the connection string to mysql://user:password@sqlserver:port and it should just work.

getting python working on apache-  look into mod-python</description>
		<content:encoded><![CDATA[<p>for mySQL &#8211; if you take the code in the comments that uses sqlalchemy, then you can just change the connection string to mysql://user:password@sqlserver:port and it should just work.</p>
<p>getting python working on apache-  look into mod-python</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Miroslav</title>
		<link>http://www.halotis.com/2009/07/07/how-to-get-rss-content-into-an-sqlite-database-with-python-fast/comment-page-1/#comment-16274</link>
		<dc:creator>Miroslav</dc:creator>
		<pubDate>Tue, 15 Sep 2009 03:50:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.halotis.com/?p=469#comment-16274</guid>
		<description>Oops, meant to say - new to Python :)</description>
		<content:encoded><![CDATA[<p>Oops, meant to say &#8211; new to Python :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Miroslav</title>
		<link>http://www.halotis.com/2009/07/07/how-to-get-rss-content-into-an-sqlite-database-with-python-fast/comment-page-1/#comment-16273</link>
		<dc:creator>Miroslav</dc:creator>
		<pubDate>Tue, 15 Sep 2009 03:49:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.halotis.com/?p=469#comment-16273</guid>
		<description>Hi, I am new to Perl but I do need this functionality for the site.  How would I import this into a MySQL database using Python?  And also, where can I find some information on how to set up Python to run under Apache?</description>
		<content:encoded><![CDATA[<p>Hi, I am new to Perl but I do need this functionality for the site.  How would I import this into a MySQL database using Python?  And also, where can I find some information on how to set up Python to run under Apache?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregory Saxton</title>
		<link>http://www.halotis.com/2009/07/07/how-to-get-rss-content-into-an-sqlite-database-with-python-fast/comment-page-1/#comment-16267</link>
		<dc:creator>Gregory Saxton</dc:creator>
		<pubDate>Mon, 14 Sep 2009 16:26:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.halotis.com/?p=469#comment-16267</guid>
		<description>Thanks, Matt! I appreciate it. I think I have the code almost working now--the last piece of the puzzle is dealing with the &quot;duplicates&quot; issue, and I think what you wrote will work. 

I just upgraded to Snow Leopard yesterday and will cross my fingers that Python works as expected. :) If it does, then I&#039;ll post the entire code on GitHub and send you a quick note. 

By the way, I&#039;m originally from Vancouver--hope you&#039;re enjoying it.</description>
		<content:encoded><![CDATA[<p>Thanks, Matt! I appreciate it. I think I have the code almost working now&#8211;the last piece of the puzzle is dealing with the &#8220;duplicates&#8221; issue, and I think what you wrote will work. </p>
<p>I just upgraded to Snow Leopard yesterday and will cross my fingers that Python works as expected. :) If it does, then I&#8217;ll post the entire code on GitHub and send you a quick note. </p>
<p>By the way, I&#8217;m originally from Vancouver&#8211;hope you&#8217;re enjoying it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Warren</title>
		<link>http://www.halotis.com/2009/07/07/how-to-get-rss-content-into-an-sqlite-database-with-python-fast/comment-page-1/#comment-16266</link>
		<dc:creator>Matt Warren</dc:creator>
		<pubDate>Mon, 14 Sep 2009 16:16:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.halotis.com/?p=469#comment-16266</guid>
		<description>Assuming you have the models defined as RSSEntries and RSSFeeds classes then converting to sqlalchemy would be something like :

&lt;pre lang=&quot;python&quot;&gt;
CONNSTRING=&#039;sqlite:///rss.sqlite&#039;

Base = declarative_base()
class RSSFeeds(Base):
    __tablename__ = &#039;RSSFeeds&#039;

    id = Column(Integer, primary_key=True)
    url = Column(String)

    def __init__(self, url):
        self.url = url

    def __repr__(self):
        return &quot;&quot; % (self.url, ))


class RSSEntries(Base):
    __tablename__ = &#039;RSSEntries&#039;

    id = Column(Integer, primary_key=True)
    url = Column(String)
    title = Column(String)
    content = Column(String)
    date = Column(Date)

    def __init__(self, url, title, content, date):
        self.url = url
        self.title = title
        self.content = content
        self.date = date

    def __repr__(self):
        return &quot;&quot; % (self.url, self.title, ))


engine = create_engine(CONNSTRING)

metadata = Base.metadata
metadata.create_all(engine) 

Session = sessionmaker(bind=engine)
session = Session()
feeds = session.query(RSSFeeds).all()

def store_feed_items(id, items):
    &quot;&quot;&quot; Takes a feed_id and a list of items and stored them in the DB &quot;&quot;&quot;
    for entry in items:
        checkitem = session.query(RSSEntries).filter_by(url=entry.link).all()
            if not checkitem:
            item = RSSEntries(entry.link, entry.title, entry.summary, entry.updated_parsed)
            session.add(item)
    session.commit()
&lt;/pre&gt;

Note:  I haven&#039;t actually tested this code to make sure it works.</description>
		<content:encoded><![CDATA[<p>Assuming you have the models defined as RSSEntries and RSSFeeds classes then converting to sqlalchemy would be something like :</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">CONNSTRING=<span style="color: #483d8b;">'sqlite:///rss.sqlite'</span>
&nbsp;
Base = declarative_base<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">class</span> RSSFeeds<span style="color: black;">&#40;</span>Base<span style="color: black;">&#41;</span>:
    __tablename__ = <span style="color: #483d8b;">'RSSFeeds'</span>
&nbsp;
    <span style="color: #008000;">id</span> = Column<span style="color: black;">&#40;</span>Integer, primary_key=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
    url = Column<span style="color: black;">&#40;</span>String<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, url<span style="color: black;">&#41;</span>:
        <span style="color: #008000;">self</span>.<span style="color: black;">url</span> = url
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__repr__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">&quot;&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">url</span>, <span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> RSSEntries<span style="color: black;">&#40;</span>Base<span style="color: black;">&#41;</span>:
    __tablename__ = <span style="color: #483d8b;">'RSSEntries'</span>
&nbsp;
    <span style="color: #008000;">id</span> = Column<span style="color: black;">&#40;</span>Integer, primary_key=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
    url = Column<span style="color: black;">&#40;</span>String<span style="color: black;">&#41;</span>
    title = Column<span style="color: black;">&#40;</span>String<span style="color: black;">&#41;</span>
    content = Column<span style="color: black;">&#40;</span>String<span style="color: black;">&#41;</span>
    date = Column<span style="color: black;">&#40;</span>Date<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, url, title, content, date<span style="color: black;">&#41;</span>:
        <span style="color: #008000;">self</span>.<span style="color: black;">url</span> = url
        <span style="color: #008000;">self</span>.<span style="color: black;">title</span> = title
        <span style="color: #008000;">self</span>.<span style="color: black;">content</span> = content
        <span style="color: #008000;">self</span>.<span style="color: black;">date</span> = date
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__repr__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">&quot;&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">url</span>, <span style="color: #008000;">self</span>.<span style="color: black;">title</span>, <span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
engine = create_engine<span style="color: black;">&#40;</span>CONNSTRING<span style="color: black;">&#41;</span>
&nbsp;
metadata = Base.<span style="color: black;">metadata</span>
metadata.<span style="color: black;">create_all</span><span style="color: black;">&#40;</span>engine<span style="color: black;">&#41;</span> 
&nbsp;
Session = sessionmaker<span style="color: black;">&#40;</span>bind=engine<span style="color: black;">&#41;</span>
session = Session<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
feeds = session.<span style="color: black;">query</span><span style="color: black;">&#40;</span>RSSFeeds<span style="color: black;">&#41;</span>.<span style="color: #008000;">all</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> store_feed_items<span style="color: black;">&#40;</span><span style="color: #008000;">id</span>, items<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot; Takes a feed_id and a list of items and stored them in the DB &quot;&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> entry <span style="color: #ff7700;font-weight:bold;">in</span> items:
        checkitem = session.<span style="color: black;">query</span><span style="color: black;">&#40;</span>RSSEntries<span style="color: black;">&#41;</span>.<span style="color: black;">filter_by</span><span style="color: black;">&#40;</span>url=entry.<span style="color: black;">link</span><span style="color: black;">&#41;</span>.<span style="color: #008000;">all</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> checkitem:
            item = RSSEntries<span style="color: black;">&#40;</span>entry.<span style="color: black;">link</span>, entry.<span style="color: black;">title</span>, entry.<span style="color: black;">summary</span>, entry.<span style="color: black;">updated_parsed</span><span style="color: black;">&#41;</span>
            session.<span style="color: black;">add</span><span style="color: black;">&#40;</span>item<span style="color: black;">&#41;</span>
    session.<span style="color: black;">commit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Note:  I haven&#8217;t actually tested this code to make sure it works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregory Saxton</title>
		<link>http://www.halotis.com/2009/07/07/how-to-get-rss-content-into-an-sqlite-database-with-python-fast/comment-page-1/#comment-16234</link>
		<dc:creator>Gregory Saxton</dc:creator>
		<pubDate>Wed, 09 Sep 2009 18:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.halotis.com/?p=469#comment-16234</guid>
		<description>Hi Matt,

I&#039;m trying to convert this script to use sqlalchemy and have a couple of questions. I am able to successfully get everything put into the RSSEntries table using sqlalchemy, but there are a few &quot;leftover pieces&quot; in the code that don&#039;t seem to translate:

1) To replace your &quot;conn=sqlite3.connect(DATABASE) line I have written &quot;conn=engine.commit&quot; (and that works). However, I don&#039;t know what to do with the &quot;conn.row_factory = sqlite3.Row&quot; line. What does that do? I&#039;ve left it out and the script still seems to work.

2) If I try to use the &quot;c=conn.cursor()&quot; line I keep getting an error:

    c = conn.cursor()
AttributeError: &#039;Connection&#039; object has no attribute &#039;cursor&#039;


I guess sqlalchemy doesn&#039;t use &quot;cursor&quot; in this fashion?

3) Because of the &quot;cursor&quot; error, I replaced your &quot;feeds = ...&quot; line with &quot;feeds = conn.execute(&#039;SELECT id, url FROM feeds&#039;).fetchall()&quot;, which works well. However, I can&#039;t get your &quot;if len(c.fetchall()) == 0&quot; line to work, even when I replace &quot;c&quot; with &quot;conn&quot; or &quot;engine.&quot; (In my initial test, I just commented out that line then the script works). I am guessing this line helps avert duplicates? Is that right? And if so, any idea how to do this using sqlalchemy? Here&#039;s the error I get:

    if len(conn.fetchall()) == 0:
AttributeError: &#039;Connection&#039; object has no attribute &#039;fetchall&#039;


I hope this makes sense--I can attach the whole code if it doesn&#039;t--and thanks in advance for any help.

-Greg</description>
		<content:encoded><![CDATA[<p>Hi Matt,</p>
<p>I&#8217;m trying to convert this script to use sqlalchemy and have a couple of questions. I am able to successfully get everything put into the RSSEntries table using sqlalchemy, but there are a few &#8220;leftover pieces&#8221; in the code that don&#8217;t seem to translate:</p>
<p>1) To replace your &#8220;conn=sqlite3.connect(DATABASE) line I have written &#8220;conn=engine.commit&#8221; (and that works). However, I don&#8217;t know what to do with the &#8220;conn.row_factory = sqlite3.Row&#8221; line. What does that do? I&#8217;ve left it out and the script still seems to work.</p>
<p>2) If I try to use the &#8220;c=conn.cursor()&#8221; line I keep getting an error:</p>
<p>    c = conn.cursor()<br />
AttributeError: &#8216;Connection&#8217; object has no attribute &#8216;cursor&#8217;</p>
<p>I guess sqlalchemy doesn&#8217;t use &#8220;cursor&#8221; in this fashion?</p>
<p>3) Because of the &#8220;cursor&#8221; error, I replaced your &#8220;feeds = &#8230;&#8221; line with &#8220;feeds = conn.execute(&#8216;SELECT id, url FROM feeds&#8217;).fetchall()&#8221;, which works well. However, I can&#8217;t get your &#8220;if len(c.fetchall()) == 0&#8243; line to work, even when I replace &#8220;c&#8221; with &#8220;conn&#8221; or &#8220;engine.&#8221; (In my initial test, I just commented out that line then the script works). I am guessing this line helps avert duplicates? Is that right? And if so, any idea how to do this using sqlalchemy? Here&#8217;s the error I get:</p>
<p>    if len(conn.fetchall()) == 0:<br />
AttributeError: &#8216;Connection&#8217; object has no attribute &#8216;fetchall&#8217;</p>
<p>I hope this makes sense&#8211;I can attach the whole code if it doesn&#8217;t&#8211;and thanks in advance for any help.</p>
<p>-Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregory Saxton</title>
		<link>http://www.halotis.com/2009/07/07/how-to-get-rss-content-into-an-sqlite-database-with-python-fast/comment-page-1/#comment-16190</link>
		<dc:creator>Gregory Saxton</dc:creator>
		<pubDate>Fri, 04 Sep 2009 01:08:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.halotis.com/?p=469#comment-16190</guid>
		<description>Thanks. That&#039;s great!</description>
		<content:encoded><![CDATA[<p>Thanks. That&#8217;s great!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

