Skip to content

Commit

Permalink
Fix #107: gh trending command results in error (#116)
Browse files Browse the repository at this point in the history
This is due to a recent change in the underlying GitHub Trends RSS data format that powers the gh trending command.
  • Loading branch information
donnemartin authored Mar 26, 2017
1 parent e80e997 commit 407528f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions gitsome/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,6 @@ def format_trending_entry(self, view_entry):
language = '(Unknown)'
language = re.sub(r'(\()', r'', language)
language = re.sub(r'(\))', r'', language)
item += click.style(
'(' + str(self.pretty_dt(trending_entry.updated_parsed)) + ')',
fg=self.config.clr_time)
if summary:
item += '\n'
summary = click.wrap_text(
Expand All @@ -606,8 +603,8 @@ def format_trending_entry(self, view_entry):
subsequent_indent=' ')
item += click.style(summary, self.config.clr_message)
item += '\n'
item += click.style(' Language: ' + language,
fg=self.config.clr_secondary)
item += click.style(' ' + language,
fg=self.config.clr_message)
return item

def format_user_repo(self, user_repo_tuple):
Expand Down
2 changes: 1 addition & 1 deletion tests/data/trends.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

formatted_trends = u'\x1b[35m 1. \x1b[0mpuikinsh/gentelella \x1b[0m\x1b[33m(just now)\x1b[0m\n Free Bootstrap 3 Admin Template\x1b[0m\n\x1b[32m Language: HTML\x1b[0m\n\x1b[35m 2. \x1b[0mrg3/youtube-dl \x1b[0m\x1b[33m(just now)\x1b[0m\n Small command-line program to download videos from YouTube.com and\n other video sites\x1b[0m\n\x1b[32m Language: Python\x1b[0m\n\x1b[35m 3. \x1b[0mFreeCodeCamp/FreeCodeCamp \x1b[0m\x1b[33m(just now)\x1b[0m\n The http://FreeCodeCamp.com open source codebase and curriculum.\n Learn to code and help nonprofits.\x1b[0m\n\x1b[32m Language: JavaScript\x1b[0m\n\x1b[35m 4. \x1b[0mmartanne/vis \x1b[0m\x1b[33m(just now)\x1b[0m\n a vim like text editor\x1b[0m\n\x1b[32m Language: C\x1b[0m\n\x1b[35m 5. \x1b[0mFezVrasta/popper.js \x1b[0m\x1b[33m(just now)\x1b[0m\n A ~3.5KB kickass library to manage your poppers\x1b[0m\n\x1b[32m Language: JavaScript\x1b[0m\n\x1b[35m 6. \x1b[0mfirehol/netdata \x1b[0m\x1b[33m(just now)\x1b[0m\n Real-time performance monitoring, done right!\x1b[0m\n\x1b[32m Language: C\x1b[0m\n\x1b[35m 7. \x1b[0marachnys/athenapdf \x1b[0m\x1b[33m(just now)\x1b[0m\n Drop-in replacement for wkhtmltopdf built on Go, Electron and Docker\x1b[0m\n\x1b[32m Language: Go\x1b[0m\n\x1b[35m 8. \x1b[0mmortenjust/cleartext-mac \x1b[0m\x1b[33m(just now)\x1b[0m\n A text editor that only allows the top 1,000 most common words in\n English\x1b[0m\n\x1b[32m Language: Swift\x1b[0m\n\x1b[35m 9. \x1b[0mfeross/webtorrent-desktop \x1b[0m\x1b[33m(just now)\x1b[0m\n WebTorrent, the streaming torrent client. For OS X, Windows, and\n Linux.\x1b[0m\n\x1b[32m Language: JavaScript\x1b[0m\n\x1b[35m 10. \x1b[0mfuture-architect/vuls \x1b[0m\x1b[33m(just now)\x1b[0m\n Vulnerability scanner for Linux, agentless, written in golang.\x1b[0m\n\x1b[32m Language: Go\x1b[0m\n\x1b[35m 11. \x1b[0mDevLight-Mobile-Agency/NavigationTabBar \x1b[0m\x1b[33m(just now)\x1b[0m\n Navigation tab bar with colorful interactions.\x1b[0m\n\x1b[32m Language: Java\x1b[0m\n\x1b[35m 12. \x1b[0mfeross/webtorrent \x1b[0m\x1b[33m(just now)\x1b[0m\n Streaming torrent client for the web\x1b[0m\n\x1b[32m Language: JavaScript\x1b[0m\n\x1b[35m 13. \x1b[0mfacebook/react \x1b[0m\x1b[33m(just now)\x1b[0m\n A declarative, efficient, and flexible JavaScript library for\n building user interfaces.\x1b[0m\n\x1b[32m Language: JavaScript\x1b[0m\n\x1b[35m 14. \x1b[0mtatsuhiro-t/aria2 \x1b[0m\x1b[33m(just now)\x1b[0m\n aria2 is a lightweight multi-protocol & multi-source, cross platform\n download utility operated in command-line. It supports HTTP/HTTPS,\n FTP, SFTP, BitTorrent and Metalink.\x1b[0m\n\x1b[32m Language: C++\x1b[0m\n\x1b[35m 15. \x1b[0mjessepollak/command \x1b[0m\x1b[33m(just now)\x1b[0m\n Making the web better with Slack-like slash commands.\x1b[0m\n\x1b[32m Language: JavaScript\x1b[0m\n\x1b[35m 16. \x1b[0msoimort/you-get \x1b[0m\x1b[33m(just now)\x1b[0m\n Dumb downloader that scrapes the web\x1b[0m\n\x1b[32m Language: Python\x1b[0m\n\x1b[35m 17. \x1b[0mpacketzoom/logzoom \x1b[0m\x1b[33m(just now)\x1b[0m\n A lightweight replacement for logstash indexer in Go\x1b[0m\n\x1b[32m Language: Go\x1b[0m\n\x1b[35m 18. \x1b[0mairbnb/caravel \x1b[0m\x1b[33m(just now)\x1b[0m\n Caravel is a data exploration platform designed to be visual,\n intuitive, and interactive\x1b[0m\n\x1b[32m Language: Python\x1b[0m\n\x1b[35m 19. \x1b[0mdylang/npm-check \x1b[0m\x1b[33m(just now)\x1b[0m\n Check for outdated, incorrect, and unused dependencies.\x1b[0m\n\x1b[32m Language: JavaScript\x1b[0m\n\x1b[35m 20. \x1b[0mkadirahq/react-storybook \x1b[0m\x1b[33m(just now)\x1b[0m\n Isolate your React UI Component development from the main app\x1b[0m\n\x1b[32m Language: JavaScript\x1b[0m\n\x1b[35m 21. \x1b[0mnnupoor/js_designpatterns \x1b[0m\x1b[33m(just now)\x1b[0m\x1b[0m\n\x1b[32m Language: JavaScript\x1b[0m\n\x1b[35m 22. \x1b[0mgooglesamples/android-architecture \x1b[0m\x1b[33m(just now)\x1b[0m\n A collection of samples to discuss and showcase different\n architectural tools and patterns for Android apps.\x1b[0m\n\x1b[32m Language: Unknown\x1b[0m\n\x1b[35m 23. \x1b[0mMrS0m30n3/youtube-dl-gui \x1b[0m\x1b[33m(just now)\x1b[0m\n A cross platform front-end GUI of the popular youtube-dl written in\n wxPython.\x1b[0m\n\x1b[32m Language: Python\x1b[0m\n\x1b[35m 24. \x1b[0mSkyscanner/SkyFloatingLabelTextField \x1b[0m\x1b[33m(just now)\x1b[0m\n A beautiful and flexible text field control implementation of "Float\n Label Pattern". Written in Swift. As used in the Skyscanner TravelPro\n iOS app.\x1b[0m\n\x1b[32m Language: Swift\x1b[0m\n\x1b[35m 25. \x1b[0mshutterstock/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words \x1b[0m\x1b[33m(just now)\x1b[0m\n List of Dirty, Naughty, Obscene, and Otherwise Bad Words\x1b[0m\n\x1b[32m Language: Unknown\x1b[0m\n View the page for \x1b[0m\x1b[35m1 through \x1b[0m\x1b[35m25\x1b[0m with the following command:\n\x1b[0m\x1b[35m gh view [#] \x1b[0moptional: [-b/--browser] [--help]\n\x1b[0m\x1b[0m'
formatted_trends = u'\x1b[35m 1. \x1b[0mpuikinsh/gentelella \x1b[0m\n Free Bootstrap 3 Admin Template\x1b[0m\n HTML\x1b[0m\n\x1b[35m 2. \x1b[0mrg3/youtube-dl \x1b[0m\n Small command-line program to download videos from YouTube.com and\n other video sites\x1b[0m\n Python\x1b[0m\n\x1b[35m 3. \x1b[0mFreeCodeCamp/FreeCodeCamp \x1b[0m\n The http://FreeCodeCamp.com open source codebase and curriculum.\n Learn to code and help nonprofits.\x1b[0m\n JavaScript\x1b[0m\n\x1b[35m 4. \x1b[0mmartanne/vis \x1b[0m\n a vim like text editor\x1b[0m\n C\x1b[0m\n\x1b[35m 5. \x1b[0mFezVrasta/popper.js \x1b[0m\n A ~3.5KB kickass library to manage your poppers\x1b[0m\n JavaScript\x1b[0m\n\x1b[35m 6. \x1b[0mfirehol/netdata \x1b[0m\n Real-time performance monitoring, done right!\x1b[0m\n C\x1b[0m\n\x1b[35m 7. \x1b[0marachnys/athenapdf \x1b[0m\n Drop-in replacement for wkhtmltopdf built on Go, Electron and Docker\x1b[0m\n Go\x1b[0m\n\x1b[35m 8. \x1b[0mmortenjust/cleartext-mac \x1b[0m\n A text editor that only allows the top 1,000 most common words in\n English\x1b[0m\n Swift\x1b[0m\n\x1b[35m 9. \x1b[0mfeross/webtorrent-desktop \x1b[0m\n WebTorrent, the streaming torrent client. For OS X, Windows, and\n Linux.\x1b[0m\n JavaScript\x1b[0m\n\x1b[35m 10. \x1b[0mfuture-architect/vuls \x1b[0m\n Vulnerability scanner for Linux, agentless, written in golang.\x1b[0m\n Go\x1b[0m\n\x1b[35m 11. \x1b[0mDevLight-Mobile-Agency/NavigationTabBar \x1b[0m\n Navigation tab bar with colorful interactions.\x1b[0m\n Java\x1b[0m\n\x1b[35m 12. \x1b[0mfeross/webtorrent \x1b[0m\n Streaming torrent client for the web\x1b[0m\n JavaScript\x1b[0m\n\x1b[35m 13. \x1b[0mfacebook/react \x1b[0m\n A declarative, efficient, and flexible JavaScript library for\n building user interfaces.\x1b[0m\n JavaScript\x1b[0m\n\x1b[35m 14. \x1b[0mtatsuhiro-t/aria2 \x1b[0m\n aria2 is a lightweight multi-protocol & multi-source, cross platform\n download utility operated in command-line. It supports HTTP/HTTPS,\n FTP, SFTP, BitTorrent and Metalink.\x1b[0m\n C++\x1b[0m\n\x1b[35m 15. \x1b[0mjessepollak/command \x1b[0m\n Making the web better with Slack-like slash commands.\x1b[0m\n JavaScript\x1b[0m\n\x1b[35m 16. \x1b[0msoimort/you-get \x1b[0m\n Dumb downloader that scrapes the web\x1b[0m\n Python\x1b[0m\n\x1b[35m 17. \x1b[0mpacketzoom/logzoom \x1b[0m\n A lightweight replacement for logstash indexer in Go\x1b[0m\n Go\x1b[0m\n\x1b[35m 18. \x1b[0mairbnb/caravel \x1b[0m\n Caravel is a data exploration platform designed to be visual,\n intuitive, and interactive\x1b[0m\n Python\x1b[0m\n\x1b[35m 19. \x1b[0mdylang/npm-check \x1b[0m\n Check for outdated, incorrect, and unused dependencies.\x1b[0m\n JavaScript\x1b[0m\n\x1b[35m 20. \x1b[0mkadirahq/react-storybook \x1b[0m\n Isolate your React UI Component development from the main app\x1b[0m\n JavaScript\x1b[0m\n\x1b[35m 21. \x1b[0mnnupoor/js_designpatterns \x1b[0m\x1b[0m\n JavaScript\x1b[0m\n\x1b[35m 22. \x1b[0mgooglesamples/android-architecture \x1b[0m\n A collection of samples to discuss and showcase different\n architectural tools and patterns for Android apps.\x1b[0m\n Unknown\x1b[0m\n\x1b[35m 23. \x1b[0mMrS0m30n3/youtube-dl-gui \x1b[0m\n A cross platform front-end GUI of the popular youtube-dl written in\n wxPython.\x1b[0m\n Python\x1b[0m\n\x1b[35m 24. \x1b[0mSkyscanner/SkyFloatingLabelTextField \x1b[0m\n A beautiful and flexible text field control implementation of "Float\n Label Pattern". Written in Swift. As used in the Skyscanner TravelPro\n iOS app.\x1b[0m\n Swift\x1b[0m\n\x1b[35m 25. \x1b[0mshutterstock/List-of-Dirty-Naughty-Obscene-and-Otherwise-Bad-Words \x1b[0m\n List of Dirty, Naughty, Obscene, and Otherwise Bad Words\x1b[0m\n Unknown\x1b[0m\n View the page for \x1b[0m\x1b[35m1 through \x1b[0m\x1b[35m25\x1b[0m with the following command:\n\x1b[0m\x1b[35m gh view [#] \x1b[0moptional: [-b/--browser] [--help]\n\x1b[0m\x1b[0m'

0 comments on commit 407528f

Please sign in to comment.