π€
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 __future__ import print_function | |
import pickle | |
import os.path | |
from googleapiclient.discovery import build | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from google.auth.transport.requests import Request | |
# If modifying these scopes, delete the file token.pickle. | |
SCOPES = ['https://www.googleapis.com/auth/gmail.readonly'] |
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 __future__ import print_function | |
import pickle | |
import os.path | |
from googleapiclient.discovery import build | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from google.auth.transport.requests import Request | |
import json | |
# If modifying these scopes, delete the file token.pickle. | |
SCOPES = ['https://www.googleapis.com/auth/contacts.readonly'] |
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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"type": "prompt", | |
"alignment": "left", | |
"segments": [ | |
{ | |
"type": "os", | |
"style": "plain", |
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
Consumer_Key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |
Consumer_Secret_Key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |
Access_Token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |
Access_Token_Secret=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
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
tweepy | |
feedparser | |
decouple | |
bs4 |
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
# importing modules | |
import feedparser | |
from bs4 import BeautifulSoup | |
import tweepy | |
import os | |
import logging | |
import datetime | |
# url for collecting news | |
url = "http://news.google.com/news?q=computational+chemistry&hl=en-US&sort=date&gl=US&num=100&output=rss" |
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
url = "http://news.google.com/news?q=artificial+intelligence+in+chemistry&hl=en-US&sort=date&gl=US&num=100&output=rss" |
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 ParseFeed(): | |
def __init__(self, url): | |
self.feed_url = url | |
def clean(self, html): | |
''' | |
Getting the text from html and doing some cleaning | |
''' | |
soup = BeautifulSoup(html) |
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
def tweet(self, text_list, url_list): | |
''' | |
Posting the news in the twitter and logging the data (First news of the list will be posted: One can modify by using random function) | |
''' | |
# removing news already tweeted | |
file_name = "tweets.txt" | |
with open(file_name, "r") as file: | |
tweet_list = file.readlines() | |
tweet_list = [x.strip() for x in tweet_list] | |
for tweet in tweet_list: |
OlderNewer