README.md in awesome_bot-1.5.1 vs README.md in awesome_bot-1.6.0

- old
+ new

@@ -1,16 +1,17 @@ # awesome_bot -:rocket: Check for links in [awesome](https://github.com/sindresorhus/awesome) projects +Verify links in [awesome](https://github.com/sindresorhus/awesome) projects :rocket: ![](http://i.giphy.com/urvsFBDfR6N32.gif) -`awesome_bot` checks for valid URLs in a file, it can be used to verify pull requests updating a README with [Travis](#travis). - [![Build Status](https://travis-ci.org/dkhamsing/awesome_bot.svg)](https://travis-ci.org/dkhamsing/awesome_bot) [![Gem Version](https://badge.fury.io/rb/awesome_bot.svg)](https://badge.fury.io/rb/awesome_bot) +[![](https://img.shields.io/badge/awesome-status-brightgreen.svg)](status.md) +`awesome_bot` checks for valid URLs in a file, it can be used to [verify pull requests](#validate-pull-requests) updating a README. + ## Installation Add this line to your application's Gemfile gem 'awesome_bot' @@ -28,31 +29,39 @@ ### Library ```ruby irb(main):001:0> require 'awesome_bot' => true -irb(main):002:0> c = File.read 'README.md' +irb(main):002:0> content = File.read 'README.md' => "..." -irb(main):003:0> r = AwesomeBot.check c +irb(main):003:0> result = AwesomeBot.check content => #<AwesomeBot::Result:0x007fdde39f4408 @links=...> # AwesomeBot Result with success, statuses_issues, dupes and more -irb(main):004:0> puts r.success ? 'No errors' : ':-(' +irb(main):004:0> puts result.success ? 'No errors' : ':-(' :-( ``` More information at [rubydoc](http://www.rubydoc.info/gems/awesome_bot). ### Command Line awesome_bot <file> [--allow-dupe] [--allow-redirect] [--allow-timeout] [--set-timeout d] [--white-list item1,item2,..] - file Path to file + file Path to file, required as first argument --allow-dupe Duplicates URLs are allowed URLs --allow-redirect Redirected URLs are allowed --allow-timeout URLs that time out are allowed --set-timeout Set connection timeout (seconds) - --white-list Comma separated URLs to white list + --white-list Comma separated URLs/domains to white list +By default, `awesome_bot` flags duplicates and URL redirects. + +- Use option `--allow-dupe` to allow duplicates. +- Use option `allow-redirect` to all redirects +- You can also white list specific links that will not be flagged (for dupe or redirect). `--white-list domain1.com/post/article,domain2.com` white lists `domain1.com/post/article` and all URLs matching `domain2.com`. + +### Examples + ```shell $ awesome_bot README.md > Checking links in README.md Links found: 56, 53 unique 1. https://github.com/sindresorhus/awesome @@ -61,18 +70,18 @@ ... 53. https://twitter.com/dkhamsing Checking URLs: ✓x→✓✓✓✓→→✓→✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓→✓✓✓✓✓✓✓✓ Issues :-( -> Links +> Links 1. 202 http://www.rubydoc.info/gems/awesome_bot 2. 301 http://rubygems.org/gems/awesome_bot → https://rubygems.org/gems/awesome_bot 3. 302 https://badge.fury.io/rb/awesome_bot.svg → https://d25lcipzij17d.cloudfront.net/badge.svg?id=rb&type=6&v=1.4.0&x2=0 4. 302 https://badge.fury.io/rb/awesome_bot → http://rubygems.org/gems/awesome_bot 5. 301 https://travis-ci.org/dkhamsing/awesome_bot.svg → https://api.travis-ci.org/dkhamsing/awesome_bot.svg 6. 301 http://gph.is/XM6gMT → http://giphy.com/gifs/urvsFBDfR6N32 -> Dupes +> Dupes 1. https://github.com/sindresorhus/awesome 2. https://github.com/veggiemonk/awesome-docker 3. https://github.com/dotfiles/dotfiles.github.com ``` @@ -95,64 +104,88 @@ ... No issues :-) ``` -## Travis +## Validate Pull Requests -Use `awesome_bot` with [Travis](https://travis-ci.org/) to validate GitHub [pull requests](https://github.com/dkhamsing/open-source-ios-apps/pull/159). +`awesome_bot` can help you validate GitHub [pull requests](https://github.com/dkhamsing/open-source-ios-apps/pull/159), it is used by -Example [`.travis.yml` file](https://github.com/dkhamsing/open-source-ios-apps/blob/master/.travis.yml) +- https://github.com/tiimgreen/github-cheat-sheet +- https://github.com/vinta/awesome-python +- https://github.com/enaqx/awesome-react +- https://github.com/vsouza/awesome-ios +- https://github.com/alebcay/awesome-shell +- https://github.com/matteocrippa/awesome-swift -``` +and [more](status.md). + + +### Travis CI + +To use `awesome_bot` with Travis CI, [connect your repo](https://travis-ci.org/) and create a [`.travis.yml` file](https://github.com/dkhamsing/open-source-ios-apps/blob/master/.travis.yml). + +```yml language: ruby rvm: - 2.2 before_script: - gem install awesome_bot script: - awesome_bot README.md ``` -`awesome_bot` is used by the following projects: +To turn off email notifications, add the lines below -1. https://github.com/vinta/awesome-python -- https://github.com/prakhar1989/awesome-courses -- https://github.com/ripienaar/free-for-dev -- https://github.com/vsouza/awesome-ios -- https://github.com/caesar0301/awesome-public-datasets -- https://github.com/matteocrippa/awesome-swift -- https://github.com/iCHAIT/awesome-osx -- https://github.com/rosarior/awesome-django -- https://github.com/ellisonleao/magictools -- https://github.com/JStumpp/awesome-android -- https://github.com/dariubs/GoBooks -- https://github.com/arslanbilal/git-cheat-sheet -- https://github.com/chentsulin/awesome-graphql -- https://github.com/fasouto/awesome-dataviz -- https://github.com/RichardLitt/awesome-conferences -- https://github.com/caesar0301/awesome-pcaptools -- https://github.com/matiassingers/awesome-readme -- https://github.com/stefanbuck/awesome-browser-extensions-for-github -- https://github.com/afonsopacifer/awesome-flexbox -- https://github.com/HQarroum/awesome-iot -- https://github.com/filipelinhares/awesome-slack -- https://github.com/notthetup/awesome-webaudio -- https://github.com/ipfs/awesome-ipfs -- https://github.com/brunopulis/awesome-a11y -- https://github.com/ramitsurana/awesome-kubernetes -- https://github.com/christian-bromann/awesome-selenium -- https://github.com/benoitjadinon/awesome-xamarin -- https://github.com/vinkla/awesome-fuse -- https://github.com/wfhio/awesome-job-boards -- https://github.com/sotayamashita/awesome-css -- https://github.com/MakinGiants/awesome-mobile-dev -- https://github.com/unixorn/awesome-zsh-plugins -- https://github.com/vredniy/awesome-newsletters -- https://github.com/unixorn/git-extra-commands -- https://github.com/deanhume/typography -- https://github.com/dotfiles/dotfiles.github.com -- https://github.com/veggiemonk/awesome-docker +```yml +notifications: + email: false +``` + +### Circle CI + +If you prefer Circle CI, it'll work too. [Connect your repo](https://circleci.com/) and create a [`circle.yml` file](https://github.com/tmcw/awesome-geojson). + +```yml +machine: + ruby: + version: 2.2.0 +test: + pre: + - gem install awesome_bot + override: + - awesome_bot README.md +``` + +### Status Badge + +[![Build Status](https://travis-ci.org/unixorn/awesome-zsh-plugins.png)](https://travis-ci.org/unixorn/awesome-zsh-plugins) + +To add the Travis CI build status badge above to your project, use the following code + +``` +[![Build Status](https://travis-ci.org/<username>/<project>.svg)](https://travis-ci.org/<username>/<project>) + +i.e. +[![Build Status](https://travis-ci.org/dkhamsing/awesome_bot.svg?branch=master)](https://travis-ci.org/dkhamsing/awesome_bot) +``` + +As it happens, the default code snippet provided contain a redirect so adding a badge could fail your status :sob:.. one way to fix this is to white list `travis-ci`, i.e. + +``` +- awesome_bot README.md --white-list travis-ci +``` + +[![Circle CI](https://circleci.com/gh/dkhamsing/awesome_bot.svg?style=svg)](https://circleci.com/gh/dkhamsing/awesome_bot) + +To add the Circle CI build status badge above to your project, use the following code + +``` +[![Circle CI](https://circleci.com/gh/<username>/<project>.svg?style=svg)](https://circleci.com/gh/<username>/<project>) + +i.e. +[![Circle CI](https://circleci.com/gh/dkhamsing/awesome_bot.svg?style=svg)](https://circleci.com/gh/dkhamsing/awesome_bot) +``` ## Credits - [`faraday` and `parallel`](awesome_bot.gemspec) - [giphy](http://gph.is/XM6gMT)