~bakrss.developers/bakrss/main

« back to all changes in this revision

Viewing changes to feedgtk.py

  • Committer: akus-py
  • Date: 2009-03-31 10:58:16 UTC
  • Revision ID: akus.py@gmail.com-20090331105816-ffkgqkrp8lr6f1vq
Display site name from database

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
import gtk.glade
6
6
import gobject
7
7
from GuiTools import Add_dialog, Prefs_dialog
 
8
from dbaseclass import DbaseFeed
8
9
 
9
10
class Feed:
10
11
    #sito="http://feeds.delicious.com/v2/rss/twelvetone"
11
12
    #sito="http://feeds.feedburner.com/pollycokenet"
12
 
    sito={"Twelvetone":"http://feeds.delicious.com/v2/rss/twelvetone","PollyCoke":"http://feeds.feedburner.com/pollycokenet"}
 
13
    #sito={"Twelvetone":"http://feeds.delicious.com/v2/rss/twelvetone","PollyCoke":"http://feeds.feedburner.com/pollycokenet"}
13
14
 
14
15
    def __init__(self):
15
16
        #Signals required for glade widgets
76
77
        self.dbase=DbaseFeed()
77
78
        self.urls=self.dbase.read()
78
79
        #METTERE NOME DA VISUALIZZARE
79
 
        
80
 
        
81
 
    def parser(self,site):
 
80
        print self.urls
 
81
        print type(self.urls)
 
82
        return self.urls
 
83
        
 
84
    def parser(self):
82
85
            diz = {}
83
 
            for sit in site.keys():
84
 
                    d = feedparser.parse(site[sit])
 
86
            url=self.LoadURL()
 
87
            print "url in parser= ",url
 
88
            for sit in url:
 
89
                    d = feedparser.parse(sit)
85
90
                    for i in range(0,len(d['items'])):
86
91
                            tmp=[]
87
92
                            self.title = d['items'][i].title
95
100
            return diz
96
101
            
97
102
    def on_add_btn_clicked(self, widget):
 
103
        self.LoadURL()
98
104
        Add_dialog()
99
105
        
100
106
    def on_refresh_btn_clicked(self, widget):
101
107
        line=1
102
 
        feeds=self.parser(self.sito)
 
108
        feeds=self.parser()
 
109
        print "feeds= ",feeds
103
110
        for key in feeds.keys():
104
111
            self.liststore.append([line,feeds[key][0],feeds[key][1],key])
105
112
            line+=1