Example #1
0
def stishkipirozhki_ru(sync_date, source, entry):
    p = Pasty()
    p.text = strip(entry['content'][0]['value'])
    p.date = to_date(entry['published_parsed'])
    if not p.date: p.date = sync_date
    p.source = source.url
    return p
Example #2
0
 def parse_entry(self, entry):
     p = Pasty()
     p.text = self.strip(entry['summary_detail']['value'])
     p.date = self.to_date(entry['published_parsed'])
     if not p.date:
         p.date = self.source.sync_date
     p.source = self.source.url
     return p
Example #3
0
def pirozhki_ru_livejournal_com(sync_date, source, entry):
    p = Pasty()
    p.text = strip(entry['summary_detail']['value'])
    p.date = to_date(entry['published_parsed'])
    if not p.date: p.date = sync_date
    p.source = source.url
    if len(p.text) > 255:
        return None
    return p
Example #4
0
 def parse_entry(self, entry):
     text = entry.find(class_='Text').text.replace('\r\n', '<br/>')
     if len(text) > self.MAX_LENGTH:
         return None
     pasty = Pasty()
     pasty.text = text
     pasty.date = to_date(entry.find(class_='date').text)
     pasty.published = True
     pasty.source = self.source.url
     return pasty
Example #5
0
 def parse_entry(self, entry):
     text = self.process_text(entry['summary_detail']['value'])
     if len(text) > self.MAX_LENGTH or \
             not remove_html_tags(text):
         return None
     pasty = Pasty()
     pasty.text = text
     pasty.date = to_date(entry['published_parsed']) or self.last_update
     pasty.published = True
     pasty.source = self.source.url
     return pasty
Example #6
0
    def parse_entry(self, entry):
        p = Pasty()
        p.text = self.strip(entry['summary_detail']['value'])
        p.votes = int(entry['lj_reply-count'])
        p.date = self.to_date(entry['published_parsed'])
        if not p.date:
            p.date = self.source.sync_date
        p.source = self.source.url

        if len(p.text) > 255:
            return None
        return p
Example #7
0
    def parse_entry(self, entry):
        # fake sync_date to remove duplicates
        text, date = entry
        p = Pasty()
        p.text = self.strip(text)

        # set latest time possible for proper sync
        date = datetime.strptime(date, '%d.%m.%Y')
        date = date.replace(hour=23, minute=59, second=59)
        p.date = date

        p.source = self.source.url
        return p