Daily news is ever shifting. A requirement to be constantly up-to-date with out having to invest hours a day reading the news.
Create a display which shows just the main headlines.
Specification:
Must always be up to date.
Must be clearly readable from a glance.
Must use free services that will be reliable long term.
The main computer, running the system.
Currently RPi 4 with Rasbian loaded. This build does work cross-platform.
Small compact screen i can mount under my main monitors.
720p with clear display.
The Bash Script automates the process of calling the individual code components it starts by declaring a while loop, this will execute constantly with no end conditions.
curl - this command transfers data from the URL assigned.
Which in this case is the "http://feeds.bbci.co.uk/news/rss.xml" which is an RSS feed of each bbc news item from the main page. Then the ">" will put the output of the curl into the directory and text file.
Next runs the parser tool, takes the output from the curl. which is a full webpage of information and processes it to extract each headline and place them within a list, this list is then outputted to another text file. Because its a constant loop by adding a sleep function the loop is delayed from resetting by 1800 seconds.
Finally the code uses pkill on the GUI application, this will allow the loop be to restarted a fresh as there will be no remaining live processes from the script.
The Parser saves an input and output stream file as objects "ifstream" and "ofstream". Opens both files and then reads each line from the input file. If it finds the start of a title header it increases a counter.
String Manipulation then occurs to find and erase around each line which increased the counter, and then write to the ofstream and into the output file.
The GUI setup creates a single textbox on screen and on window as full screen and without frame.
Then setup calls a read loop which reads each line from the input file and places into a string list.
Once input file completely read a timer is created with a Slot layout. This means every time the timer reaches 0 an interrupt signal triggers a print loop.
The print loop iterates to the next headline within the string list and can loop if reaching end of list.
Improvements:
Rename output.txt, example.txt to better names
Rename GUI string names to more followable names.
Auto-launch on system start.
Problems:
Managing to get the bash script to launch the GUI when running via chrontab.
Hardest challenges were to get the timer executed on the GUI to replace the headline text every interval using the QT QTimer library and signals and slots.