# Path: link/utils.py
# def get_page_info(url):
#     def get_page_head():
#     def get_title_from_url():
#     def summary_from_text(txt, size=250):
#     def build_tags(*args):
#     def __init__(self, html=None):
#     def __contains__(self, item):
#     def __getattr__(self, name):
#     def _parse(self, html):
# class OpenGraph:
# class LinkException(Exception):
# 
# Path: account/models.py
# class Relationship(models.Model):
#     owner = models.ForeignKey(to='account.Account', related_name='following')
#     follow = models.ForeignKey(to='account.Account', related_name='followers')
#     created_at = models.DateTimeField(auto_now_add=True)
#     updated_at = models.DateTimeField(auto_now=True)
# 
#     class Meta:
#         unique_together = ('owner', 'follow',)


import copy
from django.db import models
from link import utils
from account.models import Relationship
    summary = models.CharField(null=True, max_length=250)
    text = models.TextField(null=True)
    image_url = models.CharField(null=True, max_length=500)
    tags = models.CharField(null=True, max_length=500)
    publish_date = models.DateTimeField(null=True)
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

    def set_metadata(self):
        page_info = utils.get_page_info(self.url)
        self.type = page_info['type']
        self.title = page_info['title']
        self.summary = page_info['summary']
        self.text = page_info['text']
        self.image_url = page_info['image']
        self.tags = ','.join(page_info['tags'])
        self.publish_date = page_info['publish_date']

    def get_tags_as_list(self):
        return self.tags.split(',')

    def add_link(self, user):
        new_post = copy.copy(self)
        new_post.owner = user
        new_post.origin = self
        new_post.id = None
        new_post.save()

    @staticmethod
    def feeds(username):

# Path: link/utils.py
# def get_page_info(url):
#     def get_page_head():
#     def get_title_from_url():
#     def summary_from_text(txt, size=250):
#     def build_tags(*args):
#     def __init__(self, html=None):
#     def __contains__(self, item):
#     def __getattr__(self, name):
#     def _parse(self, html):
# class OpenGraph:
# class LinkException(Exception):
# 
# Path: account/models.py
# class Relationship(models.Model):
#     owner = models.ForeignKey(to='account.Account', related_name='following')
#     follow = models.ForeignKey(to='account.Account', related_name='followers')
#     created_at = models.DateTimeField(auto_now_add=True)
#     updated_at = models.DateTimeField(auto_now=True)
# 
#     class Meta:
#         unique_together = ('owner', 'follow',)


# Path: link/models.py
import copy
from django.db import models
from link import utils
from account.models import Relationship

    summary = models.CharField(null=True, max_length=250)
    text = models.TextField(null=True)
    image_url = models.CharField(null=True, max_length=500)
    tags = models.CharField(null=True, max_length=500)
    publish_date = models.DateTimeField(null=True)
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

    def set_metadata(self):
        page_info = utils.get_page_info(self.url)
        self.type = page_info['type']
        self.title = page_info['title']
        self.summary = page_info['summary']
        self.text = page_info['text']
        self.image_url = page_info['image']
        self.tags = ','.join(page_info['tags'])
        self.publish_date = page_info['publish_date']

    def get_tags_as_list(self):
        return self.tags.split(',')

    def add_link(self, user):
        new_post = copy.copy(self)
        new_post.owner = user
        new_post.origin = self
        new_post.id = None
        new_post.save()

    @staticmethod
    def feeds(username):

        follower_ids = Relationship.objects.filter(