Seguro que te interesa (GitHub behind the scenes – parte 1)
Esta entrada es un poco atípica, realmente no es más que una excusa para presentaros el nuevo repositorio en GitHub de esta web.
Poco a poco quiero ir ofreciendo los scripts que me hacen la vida más sencilla y que pueden ayudaros en ciertas tareas. Para estrenar el repo, he pensado en contar cómo hago la entrada de los Viernes en las que os listo las noticias que me han parecido más interesantes de la semana.
Tras unas cuantas entradas en las que iba recopilando enlaces a mano, decidí que así no podía continuar. Como dice un gran amigo, soy muy vago, pero vago de los buenos. Eso me hace pensar en cómo automatizar absolutamente todo lo que hago para que las tareas repetitivas las haga una CPU y yo pueda centrarme en ideas felices o a imaginar qué isla me compraré cuando me toque la lotería.
Gracias a lo de internet, tiro de Twitter para estar al tanto de las noticias de última hora y suelo hacer retweet de lo que me llama la atención. Noticias, herramientas, análisis, humor… pero todo relacionado con lo que me apasiona, la seguridad de la información.
Como últimamente le he cogido cariño a Python (al pitón como le llamo alegremente por la oficina de Dive), decidí tirar de un poco de crawling vía BeautifulSoup para buscar en twitter ciertos elementos.
Básicamente lo que hago es abrir la página de Twitter de SecurityInside y busco todos los retweets. De cada uno, me quedo con los elementos interesantes (título, autor, imágen y texto) y los pongo en forma de tabla para que se vea de forma decente como una entrada del blog. Básicamente esto:
# Get retweet info # --------------------------------------------------------------------------------------- req = requests.get(url) statusCode = req.status_code if statusCode == 200: html = BeautifulSoup(req.text, "html.parser") for timeline in html.find_all('div', {'data-test-selector':'ProfileTimeline'}): for oltag in timeline.find_all('ol', {'id':'stream-items-id'}): for litag in oltag.find_all('li'): for div in litag.find_all('div', {"class" : "tweet"}): try: if div['data-retweet-id']: for small in litag.find_all('small', {"class" : "time"}): for a in small.find_all('a', {"class" : "tweet-timestamp"}): try: date = a['title'].encode("ascii", "ignore") except Exception as e: None title = div.find('p', {'class':'TweetTextSize'}).getText().split('http')[0].encode("ascii", "ignore") link = div.find('a', {'class':'twitter-timeline-link'}).getText().encode("ascii", "ignore") name = div.find('span', {'class':'username'}).getText().split('@')[1].encode("ascii", "ignore") for img in div.find_all('img'): if 'avatar' in img: image = 'http://securityinside.info/wp-content/uploads/logo.png' else: image = img['src'].encode("ascii", "ignore") print '<tr><td style="vertical-align:middle;border:0px;margin: 0px 0px"><img class="aligncenter" src="' + image + '" alt="' + name + '" width="150"/></td>\n<td style="vertical-align:middle;border:0px;margin: 0px 0px"><strong><a href="https://twitter.com/' + name + '" target="_blank">' + date + ' @' + name + ':<br></a></strong> <a href="' + link + '" target="_blank">' + title + '</a></td></tr>' except Exception as e: None else: print "Status Code %d" %statusCode
Como podéis ver, sólo tengo que copiar la línea que me genera el script e insertarla en la entrada. La tarea se completa añadiendo el texto habitual y configurando las categorías, la imágen y los valores SEO.
Vale, me vais a decir que eso también se puede automatizar. La respuesta es que si, por eso os dejo pendiente la segunda parte del artículo en la que dedicaré otro rato a generar la entrada completa (insertando en base de datos y demás).
Pero poco a poco, que estoy un poco liado gestionando los backups anti malware de la junta directiva… pero eso es otra historia que os voy a contar en breve.
¿Os lo vais a perder?
- GuardDuty: Un viaje a través del tiempo en AWS Security - 21 noviembre, 2023
- Webinar – Seguridad para familias - 11 enero, 2021
- SecurityInside Live: CISO Day 2020 - 17 septiembre, 2020
This piece was both insightful and entertaining! For additional info, visit: FIND OUT MORE. What do others think?
mexican border pharmacies shipping to usa: mexican pharmacy online – mexican online pharmacies prescription drugs
п»їbest mexican online pharmacies
http://cmqpharma.com/# mexican border pharmacies shipping to usa
buying prescription drugs in mexico
Hello there, just became alert to your blog through Google, and found that
it is really informative. I’m gonna watch out for brussels.
I will appreciate if you continue this in future.
Numerous people will be benefited from your writing.
Cheers! Escape room
I was looking at some of your content on this internet site and I conceive this web site is really informative!
Keep on putting up..
medicine in mexico pharmacies: online mexican pharmacy – medicine in mexico pharmacies
pharmacy wholesalers canada: canadian pharmacy ed medications – canadadrugpharmacy com
https://indiapharmast.com/# reputable indian pharmacies
https://canadapharmast.online/# ordering drugs from canada
mexico pharmacies prescription drugs: buying prescription drugs in mexico – mexican border pharmacies shipping to usa
reputable canadian pharmacy reputable canadian pharmacy ordering drugs from canada
canada drugstore pharmacy rx precription drugs from canada legit canadian pharmacy
medicine in mexico pharmacies: reputable mexican pharmacies online – medicine in mexico pharmacies
mexican border pharmacies shipping to usa: best online pharmacies in mexico – medication from mexico pharmacy
https://foruspharma.com/# reputable mexican pharmacies online
buying prescription drugs in mexico purple pharmacy mexico price list reputable mexican pharmacies online
canadian king pharmacy: safe online pharmacies in canada – canadian pharmacy oxycodone
http://foruspharma.com/# best online pharmacies in mexico
my canadian pharmacy review canadianpharmacyworld canadian pharmacy 24h com
mexican online pharmacies prescription drugs: buying prescription drugs in mexico online – buying from online mexican pharmacy
northwest canadian pharmacy: canadian pharmacy victoza – best rated canadian pharmacy
ed meds online canada: canadian pharmacy review – canada pharmacy online
canadian pharmacy cheap: rate canadian pharmacies – canada pharmacy reviews
http://foruspharma.com/# medicine in mexico pharmacies
my canadian pharmacy review canadian pharmacy sarasota canadian drug prices
online canadian pharmacy: recommended canadian pharmacies – canadian pharmacy world
canadian pharmacy no scripts: my canadian pharmacy – onlinepharmaciescanada com
mexican mail order pharmacies mexican mail order pharmacies reputable mexican pharmacies online
cheapest online pharmacy india: reputable indian online pharmacy – india online pharmacy
medicine in mexico pharmacies: mexican rx online – mexican pharmaceuticals online
After going over a number of the articles on your site, I honestly appreciate your way of blogging. I bookmarked it to my bookmark webpage list and will be checking back soon. Take a look at my web site too and let me know your opinion.
mexican online pharmacies prescription drugs mexican pharmaceuticals online mexico pharmacy
medication from mexico pharmacy: mexican online pharmacies prescription drugs – mexico pharmacies prescription drugs
п»їlegitimate online pharmacies india: world pharmacy india – indian pharmacy
reddit canadian pharmacy: canada ed drugs – canadian pharmacy oxycodone
paxlovid for sale: paxlovid price – paxlovid for sale
https://amoxildelivery.pro/# amoxicillin capsule 500mg price
amoxicillin tablet 500mg: amoxicillin 500mg price canada – amoxicillin 500mg price canada
https://paxloviddelivery.pro/# paxlovid generic
http://amoxildelivery.pro/# amoxicillin 250 mg price in india
Hello there! This blog post couldn’t be written any better! Looking through this article reminds me of my previous roommate! He always kept talking about this. I’ll send this information to him. Fairly certain he will have a very good read. I appreciate you for sharing!
paxlovid pharmacy: paxlovid cost without insurance – paxlovid generic
https://paxloviddelivery.pro/# Paxlovid over the counter
Paxlovid buy online: paxlovid pill – Paxlovid buy online
https://paxloviddelivery.pro/# paxlovid india
Good post. I definitely love this site. Thanks!
https://doxycyclinedelivery.pro/# doxycycline 200mg tablet
cost of clomid for sale: can you get clomid – where can i buy cheap clomid online
http://clomiddelivery.pro/# order generic clomid no prescription
https://doxycyclinedelivery.pro/# doxycycline 100mg uk
doxycycline 10mg cost: doxycycline order online – doxycycline 150 mg cost
https://doxycyclinedelivery.pro/# doxycycline 500mg price
https://clomiddelivery.pro/# where to get generic clomid
cost of generic clomid pills: cost of clomid prices – where buy clomid for sale
http://clomiddelivery.pro/# order clomid without rx
http://clomiddelivery.pro/# where to get cheap clomid without dr prescription
You ought to be a part of a contest for one of the greatest sites on the internet. I am going to highly recommend this site!
https://doxycyclinedelivery.pro/# doxycycline gel in india
cost of amoxicillin: buying amoxicillin in mexico – amoxicillin 500 mg tablet
https://clomiddelivery.pro/# where to get generic clomid without rx
where can i get clomid pill: how to buy clomid without rx – can i get cheap clomid tablets
http://doxycyclinedelivery.pro/# average cost for doxycycline
amoxicillin 500 mg cost: amoxicillin 500 mg tablet – amoxicillin 200 mg tablet
where to buy cipro online: п»їcipro generic – buy cipro online usa