Verified Commit ba621ad6 authored by Anton Akhmerov's avatar Anton Akhmerov
Browse files

minore cleanup

parent 889000df
......@@ -28,6 +28,8 @@ import os
import requests
import feedparser
import tqdm
import tweepy
import jinja2
# -
......@@ -144,7 +146,7 @@ def points_near_jet(img, r, plot=False):
ax.scatter(*img.T, s=5, c='C1', label='RGB points of figure')
plt.legend()
plt.show()
return pts
......@@ -202,8 +204,6 @@ for paper_id in tqdm.tqdm(todays_ids):
jet_papers.append(paper_id)
break
jet_papers
# # Tweet stuff
# +
......@@ -213,10 +213,6 @@ jet_papers
# os.environ['API_SECRET_KEY'] = getpass()
# os.environ['ACCESS_TOKEN'] = getpass()
# os.environ['ACCESS_TOKEN_SECRET'] = getpass()
# -
import tweepy
import jinja2
# +
# Authenticate to Twitter
......@@ -226,13 +222,13 @@ auth.set_access_token(os.environ['ACCESS_TOKEN'], os.environ['ACCESS_TOKEN_SECRE
# Create API object
api = tweepy.API(auth)
# + jupyter={"outputs_hidden": true}
# +
# # Create a tweet
# api.update_status("🚓 INITATING arxiv/cond-mat PATROL SEQUENCE 🚓")
# -
status_report = jinja2.Template("""arXiv/cond-mat STATUS REPORT {{date.strftime('%d/%m/%Y')}}
{% if jet_papers %}
🚨🚨 USAGE OF JET COLORMAP DETECTED IN {{ jet_papers | length }} PREPRINTS 🚨🚨:
🚨🚨 JET COLORMAP DETECTED IN {{ jet_papers | length }} PREPRINTS 🚨🚨:
{{ ', '.join(jet_papers) }}
CITIZENS BEWARE!
......@@ -243,4 +239,8 @@ NO JET USAGE DETECTED.
print(status_report.render(date=date.today(), jet_papers=jet_papers))
api.update_status(status_report.render(date=date.today(), jet_papers=jet_papers))
# +
# api.update_status(status_report.render(date=date.today(), jet_papers=jet_papers))
# -
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment