Exemplo n.º 1
0
    def get_links_with_tag(self, tag):
        tags = Tag.objects.filter(value=tagStr)
        collection = LinkCollection()  
        
        for item in tags:
            link = LinkbotLink()
            link.url = item.link.url
            collection.add_link(link)

        return collection
Exemplo n.º 2
0
    def recent(self, count=5):
        links = Link.objects.all()[:count]
        collection = LinkCollection() 

        for item in links:
            link = LinkbotLink()
            link.url = item.url
            collection.add_link(link)

        return collection
Exemplo n.º 3
0
    def get_links_with_tag(self, tag):
        posts = self.pinboard.posts(tag=tag)
        collection = []

        for post in posts:
            link = Link()
            link.url = post['href']
            link.description = post['description']
            link.tags = post['tags']
            collection.append(link)

        return collection
Exemplo n.º 4
0
    def recent(self, count=5):
        posts = self.pinboard.posts(count=count)
        collection = []

        for post in posts:
            link = Link()
            link.url = post['href']
            link.description = post['description']
            link.tags = post['tags']
            collection.append(link)
        
        return collection