Skip to content

Instantly share code, notes, and snippets.

View cyberandy's full-sized avatar
:octocat:
Yo!

Andrea Volpini cyberandy

:octocat:
Yo!
View GitHub Profile
@cyberandy
cyberandy / read-GNews.py
Last active January 5, 2024 19:48
A super-simple python script to read Google News RSS feeds and store data in a CSV file.
# Expected use >> python read-GNews.py -q [query] -l [language] -p [country]
# The following command will search for the latest news written in German from Austria about "Redbull"
# python read-GNews.py -q Redbull -l de -p AT
#
# Queries can be provided as strings using quotation marks >> python read-GNews.py -q "Redbull Media House" -l de
# Multiple queries can be executed at once >> python read-GNews.py -q "Redbull Media House" -q Redbull -l de -p at -p de
# The script will save a CSV file containing Title, Link, pubDate, Description, Source and Alexa Traffic Rank.
import feedparser
import time
@cyberandy
cyberandy / generate-kw.py
Last active April 26, 2019 20:30
How to generate keywords using textgenrnn (read more about it here: https://wordlift.io/blog/en/keyword-suggestion-tool-tensorflow/)
from textgenrnn import textgenrnn
textgen = textgenrnn(weights_path='keygen_weights.hdf5',
vocab_path='keygen_vocab.json',
config_path='keygen_config.json')
textgen.generate_samples(max_gen_length=5, temperatures=[0.2,0.5])
@cyberandy
cyberandy / generate-md.py
Last active August 19, 2023 18:53 — forked from pshapiro/metadesc.py
Use sumy summarizer to extract summary from HTML pages that can be used for meta descriptions.
import csv
import os
import requests, sys
import pandas as pd
from sumy.parsers.html import HtmlParser
from sumy.parsers.plaintext import PlaintextParser
from sumy.nlp.tokenizers import Tokenizer
from sumy.summarizers.lsa import LsaSummarizer as Lsa
from sumy.summarizers.luhn import LuhnSummarizer as Luhn
from sumy.summarizers.text_rank import TextRankSummarizer as TxtRank
Verifying my Blockstack ID is secured with the address 13a7qtZbLBSMrY32fZLoKtcnnkEzRmezob https://explorer.blockstack.org/address/13a7qtZbLBSMrY32fZLoKtcnnkEzRmezob