HackerShackOfficial / Smart-Mirror

Raspberry powered mirror which can display news, weather, calendar events
MIT License
908 stars 384 forks source link

How to make use of the news? #73

Closed markferreira01 closed 6 years ago

markferreira01 commented 7 years ago

Has anyone figured out a way to take the news headline and scroll the text? Or even better scroll the article that's tied to the headline?

markferreira01 commented 6 years ago

Ops didn't mean to close it.

PWRxPSYCHO commented 6 years ago

To scroll the text you could create a Text widget and then add a scroll. (Check Tkinter documentation) and put all the headlines in there, and then set the size to show only 5 articles. Once you call the method again to refresh the articles you could have it scroll up to fill in the new text. However, you would want to erase the old headlines after 10 refreshes just so you are not making too many necessary variables. Also to have the articles scroll you could set a timer, display the first headline, then after x amount of time begin to display the article by calling the RSS feed Dictionary key related to the article. Then change the widget in the bottom to a scrolling text box and have the article scroll at a speed you set until finished. Then go to the next one.

markferreira01 commented 6 years ago

Hmmm...good suggestion. I'll take a look at this. Thanks for the idea!