Ejemplo n.º 1
0
class TW_Tagger:
    def __init__(self):
        self.bot = TweepyBot()
        self.tagger = Tagger()

    def tag(self, username):
        tweets = '. '.join(self.bot.get_tweets(username))
        tweets = tweets.replace('\\n', ' ')
        sents = sent_tokenize(tweets)
        data = []
        for sent in sents:
            data += word_tokenize(sent)
        return self.tagger.tag(data)
Ejemplo n.º 2
0
class Insta_Tagger:
    def __init__(self):
        self.bot = InstagramBot()
        self.tagger = Tagger()

    def tag(self, username):
        posts = self.bot.get_data(username)
        text = ''
        for key in posts.keys():
            if not 'postInfo' in key:
                text += posts[key] + '.'
        data = []
        sents = sent_tokenize(text)
        for sent in sents:
            data += word_tokenize(sent)
        return self.tagger.tag(data)
Ejemplo n.º 3
0
class YT_Tagger:
    def __init__(self):
        self.bot = YoutubeBot()
        self.tagger = Tagger()

    def tag(self, id):
        print(self.bot.all_videos(id))
        return self.tag_videos(self.bot.all_videos(id))

    def tag_videos(self, videos):
        allwords = ''
        for video in videos:
            caps = self.bot.get_captions(video)
            caps = caps.replace('\\n', ' ') + '.'
            allwords += caps
        sents = sent_tokenize(allwords)
        data = []
        for sent in sents:
            data += word_tokenize(sent)
        return self.tagger.tag(data)
Ejemplo n.º 4
0
 def __init__(self):
     self.bot = InstagramBot()
     self.tagger = Tagger()
Ejemplo n.º 5
0
from jinja2 import Environment, BaseLoader
from urllib.parse import unquote
import secrets
import yagmail
import nltk
from app.scraping import scraping_workflow
from app.scraping.tagger import Tagger
from app.scraping.authentication import auth
import stripe
import json
from requests_oauthlib import OAuth1Session
import requests
import re
from lxml import html
nltk.download('punkt')
searchtagger = Tagger()


@app.route("/")
def main():
    #returns the home page on start
    return render_template('home.html')


@app.route("/about")
def about():  #returns the about page
    return render_template('About.html')


@app.route("/checkusername", methods=['POST'])
def checkusername():
Ejemplo n.º 6
0
 def __init__(self):
     self.bot = YoutubeBot()
     self.tagger = Tagger()
Ejemplo n.º 7
0
 def __init__(self):
     self.bot = TweepyBot()
     self.tagger = Tagger()