This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| import pandas as pd | |
| from pymongo import MongoClient, errors | |
| from datetime import datetime, timedelta | |
| import threading | |
| import logging | |
| import os | |
| import pymongo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from io import StringIO | |
| from typing import List | |
| from PyPDF2 import PdfReader | |
| def convert_pdf_to_txt(pdf_file_path: str) -> str: | |
| with open(pdf_file_path, 'rb') as f: | |
| pdf = PdfReader(f) | |
| pages: List[str] = [] | |
| for page in pdf.pages: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tweepy | |
| import pymongo | |
| import os | |
| from flask import Flask, request | |
| from flask import jsonify | |
| from flask import make_response | |
| import yaml | |
| from werkzeug.exceptions import NotFound | |
| # Set up Flask app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class News: | |
| def __init__(self, id, text, created_at): | |
| self.id = id | |
| self.text = text | |
| self.created_at = created_at | |
| def save_to_db(self): | |
| news_collection = db["news_collection"] | |
| news_collection.insert_one({ | |
| "id": self.id, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| current_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') | |
| git pull origin $current_branch | |
| echo "=== pull changes from '$current_branch' branch ===" | |
| msg="$1" |