Coder Social home page Coder Social logo

awesome_bot's Introduction

awesome_bot

๐Ÿš€ Check for links in awesome projects

awesome_bot checks for valid URLs in a file, it can be used to verify pull requests updating a README with Travis.

Build Status Gem Version

Installation

Add this line to your application's Gemfile

gem 'awesome_bot'

And then execute

$ bundle

Or install it yourself as

$ gem install awesome_bot

Usage

Library

irb(main):001:0> require 'awesome_bot'
=> true
irb(main):002:0> c = File.read 'README.md'
=> "..."
irb(main):003:0> r = AwesomeBot.check c
=> #<AwesomeBot::Result:0x007fdde39f4408 @links=...>
# AwesomeBot Result with success, statuses_issues, dupes and more
irb(main):004:0> puts r.success ? 'No errors' : ':-('
:-(

More information at rubydoc.

Command Line

awesome_bot <file> [--allow-dupe] [--allow-redirect] [--allow-timeout] [--set-timeout d] [--white-list item1,item2,..]    
  file 		     Path to file
  --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
$ awesome_bot README.md
> Checking links in README.md
Links found: 46, 14 unique
  1. https://github.com/sindresorhus/awesome
  2. http://i.giphy.com/12qq4Em3MVuwJW.gif
  3. https://travis-ci.org/dkhamsing/awesome_bot.svg
  4. https://travis-ci.org/dkhamsing/awesome_bot
  5. https://badge.fury.io/rb/awesome_bot.svg
  6. https://badge.fury.io/rb/awesome_bot
  7. http://www.rubydoc.info/gems/awesome_bot
  8. https://travis-ci.org/
  9. http://gph.is/1gU5itl
  10. https://github.com/dkhamsing
  11. https://twitter.com/dkhamsing
  12. https://github.com/dkhamsing/open-source-ios-apps/pull/159
  13. https://github.com/dkhamsing/open-source-ios-apps/blob/master/.travis.yml
  14. https://codeload.github.com/dkhamsing/awesome_bot/tar.gz/wip
Checking URLs: โœ“โ†’โ†’xโ†’โ†’โœ“โœ“โœ“โœ“xโœ“โœ“โœ“

Issues :-(
> Links
1. 302 https://badge.fury.io/rb/awesome_bot.svg
2. 302 https://badge.fury.io/rb/awesome_bot
3. 202 http://www.rubydoc.info/gems/awesome_bot
4. 301 http://gph.is/1gU5itl
5. 301 https://travis-ci.org/dkhamsing/awesome_bot.svg
6. 404 https://codeload.github.com/dkhamsing/awesome_bot/tar.gz/wip
> Dupes
  1. https://github.com/sindresorhus/awesome
  2. http://i.giphy.com/12qq4Em3MVuwJW.gif
  3. https://travis-ci.org/dkhamsing/awesome_bot.svg
  4. https://travis-ci.org/dkhamsing/awesome_bot
  5. https://travis-ci.org/
  6. http://gph.is/1gU5itl
  7. https://github.com/dkhamsing
  8. https://twitter.com/dkhamsing
  9. https://github.com/dkhamsing/open-source-ios-apps/pull/159
  10. https://github.com/dkhamsing/open-source-ios-apps/blob/master/.travis.yml
  11. https://codeload.github.com/dkhamsing/awesome_bot/tar.gz/wip
$ awesome_bot README.md --allow-dupe --white-list fury,gph.is,rubydoc,travis,codeload
> Checking links in README.md
> Will allow duplicate links
> White list: fury, gph.is, rubydoc, travis, codeload
Links found: 20, 33 white listed
  1. https://github.com/sindresorhus/awesome
  2. http://i.giphy.com/12qq4Em3MVuwJW.gif
  3. https://github.com/dkhamsing
  4. https://twitter.com/dkhamsing
  5. https://github.com/dkhamsing/open-source-ios-apps/pull/159
Checking URLs: โœ“โœ“โœ“โœ“โœ“
Checking white listed URLs: โ†’xโ†’โ†’โœ“โ†’โœ“xโœ“

> White listed:
  1. 301: http://gph.is/1gU5itl
  2. 202: http://www.rubydoc.info/gems/awesome_bot
  3. 302: https://badge.fury.io/rb/awesome_bot
  4. 302: https://badge.fury.io/rb/awesome_bot.svg
  5. 200: https://travis-ci.org/dkhamsing/awesome_bot
  6. 301: https://travis-ci.org/dkhamsing/awesome_bot.svg
  7. 200: https://travis-ci.org/
  8. 404: https://codeload.github.com/dkhamsing/awesome_bot/tar.gz/wip
  9. 200: https://github.com/dkhamsing/open-source-ios-apps/blob/master/.travis.yml
No issues :-)

Travis

Use awesome_bot with Travis to validate GitHub pull requests.

Example .travis.yml file

language: ruby
rvm:
  - 2.2
before_script:
  - gem install awesome_bot
script:
  - awesome_bot README.md

awesome_bot is used by the following projects:

  1. https://github.com/vinta/awesome-python

Credits

Contact

License

This project is available under the MIT license. See the LICENSE file for more info.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.