view backend/couchdb/scripts/findUnlinkedArticles.py @ 258:4ca1fac32dde

Pull the constant of days to keep feed entries into the abstract class
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 12 Mar 2019 02:39:18 +0100
parents 5bbb1e707e56
children
line wrap: on
line source

#!/usr/bin/env python

import couchdb

server = couchdb.Server('http://xanthippe:5984')
database = server['feedworm']

#result = database.view('feedworm/feeds_with_unread_entries', group=True)
#for entry in result:
##	print(entry.key)
#	try:
#		document = database[entry.key]
#	except:
#		print('no doc for feed {0}'.format(entry.key))

#feed = '326ab7561eaadee0773c88262906a0a4'
#result = database.view('feedworm/feedEntries_by_feed', startkey=[feed], endkey=[feed, {}])
#for row in result:
#	#del database[row.id]
#	print(row.id)

feed = '12cd35559a627cc7f4b43d213b24201d'
result = database.view('feedworm/feedEntries_by_feed', startkey=[feed], endkey=[feed, {}])
for row in result:
	print(row)