Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7769285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:07:18+00:00 2026-06-01T16:07:18+00:00

I am reading the news.ycombinator RSS feed using python and storing them in a

  • 0

I am reading the news.ycombinator RSS feed using python and storing them in a database using sqlite3. For example, a sample entry that is being fed to the database is (id,title,ur)

('3814508', 'Github is making me feel stupid(er)', 'http://www.serpentine.com/blog/2012/04/08/github-is-making-me-feel-stupider/')

Where the id is the comment id used by the website in their comment thread urls. The above list is made by individually extracting ids, title and url then zipping them. Now I wish to populate a database with such entries sans duplication,

import sqlite3 as lite

con = lite.connect('/path/to/rss.db')
con.text_factory = str
cur=con.cursor()
# --- Extract ids, links, urls ----
zipped = zip( ids, titles, targets)
cur.execute("SELECT Id FROM Posts")
existing_ids = cur.fetchall()
for i in range(0,len(zipped)):
    if ids[i] not in existing_ids:
        cur.executemany("INSERT INTO Posts VALUES(?, ?, ?)", zipped)

The problem is that there are thirty feeds at a time. Printing the lists show normal behaviour, with 30 entires. But when I try to write to the database there is a large number of entries, the same thirty items are repeated over and over 31 times in the table “Posts”

sqlite> SELECT Count(*) FROM Posts;
930

The db has the schema CREATE TABLE Posts(Id TEXT, Title TEXT, Target TEXT);

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:07:19+00:00Added an answer on June 1, 2026 at 4:07 pm

    It looks like you’re inserting the entire list of all the entries once you find one that is missing? Perhaps you mean to iterate over each tuple of zipped, and check each one if it’s already existing?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my Flex 4 app, I access an RSS feed (I'm using http://news.ycombinator.com/rss as
I'm reading a rss feed using simple code: <?php $homepage = file_get_contents('http://www.forbes.com/news/index.xml'); $movies =
I'm designing a news-reading app and using the NavigateToString() of a webbrowser to show
After reading about CCR : http://www.infoq.com/news/2008/12/CCR I get the impression that it does pretty
from a PHP script I'm downloading a RSS feed like: $fp = fopen('http://news.google.es/news?cf=all&ned=es_ve&hl=es&output=rss','r') or
I was reading a comment about server architecture. http://news.ycombinator.com/item?id=520077 In this comment, the person
I am using 2.1. I am reading a RSS like like one. What I
I have a problem with reading an rss feed in my site. When i
Hi i want to make an feed reading application that it should look like
Reading source code of sample projects, such as Beast and Bort, are recommended as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.