nooblag / pddgnimi Goto Github PK
View Code? Open in Web Editor NEWScrapes news articles from DuckDuckGo for a search query and sends the output to an email.
Scrapes news articles from DuckDuckGo for a search query and sends the output to an email.
If search result is No news articles found for X
then don't send an email?
Perhaps add changes to build a config file on first run of the script. So the user is asked basic setup questions, which could also incorporate desired changes of #1 where the mailserver will be tested first, and if working, a config file built with those settings. It would be also desirable to encrypt some entries, such as SMTP password.
Maybe this would be helpful?
If SMTP auth password is changed on the remote server, the script crashes because it's using the old login stored in the config file. Could add a check here to catch this condition and perhaps offer option to update config file?
... could do this by having a first runtime "setup" where script asks users for settings and writes that to a config file?
Maybe this might help...
If script is run not in current working directory, we get stuff like:
Traceback (most recent call last):
File "/home/n/Projects/pddgnimi/pddgnimi.py", line 146, in <module>
style = open("style.css", "r")
FileNotFoundError: [Errno 2] No such file or directory: 'style.css'
and output.html
saved wherever, etc.
Need to introduce code to either cd
to where script resides, or specify its path in refs to files.
Add code to set search scope to past day/week/month, rather than hardcoding "Past day."
sys.argv
should be 2
maybe and bump over email address, so a line makes more sense:
python3 pddgnimi.py "search query" day [email protected]
python3 pddgnimi.py "search query" week [email protected]
python3 pddgnimi.py "search query" month [email protected]
Improve the config file handling so the SMTP auth password is not saved in plain text. At least obfuscate with some encoding, or better yet, encryption.
Currently, script does not run in virtual environment, and hence we may have issues with import
versioning, etc. Should rewrite so script builds and configures virtual environment on first run, and then work out how to invoke cron inside it, etc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.