You use GitHub all day long as a developer. Now learn how to use GitHub as a power user. Learn the ins and outs of the GitHub API using many of the most popular programming languages. Supercharge your development with command line shortcuts. Each chapter digs deep into an important technology from the GitHub ecosystem with examples to accelerate your usage of those features and programmatically automate your developer tools. Along the way, align yourself with the famed GitHub culture to streamline your developer workflow. Copyright 3 Table of Contents 4 Preface 8 Who You Are 8 What You Will Learn 9 First Class Languages You Need to Know 10 Who This Book is Not For 10 Conventions Used in This Book 10 Using Code Examples 11 Safari® Books Online 12 How to Contact Us 12 Acknowledgments 13 Chapter 1. Introduction 14 cURL: a starting point for API exploration 17 Breadcrumbs to Successive API Paths 18 The JavaScript Object Notation (JSON) Format 18 Parsing JSON from the Command Line 19 Debugging Switches for cURL 21 All The Headers and Data 22 Authentication 24 Username and Password Authentication 24 oAuth 25 Status Codes 27 Success (200 or 201) 28 Naughty JSON (400) 28 Improper JSON (422) 28 Successful Creation (201) 29 Nothing Has Changed (304) 30 Conditional Requests to Avoid Rate Limitations 30 GitHub API Rate Limits 32 Reading Your Rate Limits 32 Accessing Content from the Web 33 JSON-P 34 CORS Support 35 Specifying Response Content Format 36 GitHub Has Amazing API Documentation 37 Summary 37 Chapter 2. Gists and the Gist API 38 Gists are repositories 38 Embedding Gists Inside HTML 39 Embedding Inside Jekyll blogs 39 Gist from the command line 40 Gists as fully functioning apps 41 Gists that render Gists 43 Going deeper into the Gist API 44 Summary 46 Chapter 3. Gollum 48 “The Story of Smeagol...” 48 Repository Linked Wikis 49 Markup and Structure 50 Moving Gollum to Your Laptop 53 Alternative Editing Options 53 Editing with the Command Line 54 Adding Authentication 54 Building a Gollum Editor 55 Hacking Gollum 56 Wireframe Review Tool 57 Programmatically Handling Images 58 Leveraging the Rugged Library 60 Optimizing for Image Storage 62 Reviewing on GitHub 65 Improving Revision Navigation 67 Summary 69 Chapter 4. Python and the Search API 70 General Principles 70 Authentication 71 Result Format 71 Search Operators and Qualifiers 72 Sorting 73 Search APIs in Detail 73 Repository Search 73 Code Search 74 Issue Search 75 User Search 76 Our example application 77 User flow 78 Python 79 AGitHub 80 WxPython 80 PyInstaller 80 The Code 81 Git credential helper 81 Windowing and interface 83 GitHub login 86 GitHub search 88 Displaying results 90 Packaging 92 Summary 92 Chapter 5. DotNet and the Commit Status API 94 The API 95 Raw statuses 96 Combined status 96 Creating a status 97 Let’s write an app 98 Libraries 98 Following along 99 First steps 102 OAuth flow 103 Status handler 106 Summary 108 Chapter 6. Ruby and Jekyll 110 The Harmless Brew that Spawned Jekyll 111 (Less Than) Evil Scientist Parents 112 Operating Jekyll Locally 112 A Jekyll Blog in 15 Minutes 113 YFM: YAML Front Matter 116 Jekyll markup 118 Using the jekyll command 118 Privacy Levels with Jekyll 119 Themes 119 Publishing on GitHub 119 Hosting On Your Own Domain 120 Importing from other blogs 122 From Wordpress 122 Exporting from Wordpress alternatives 124 Scraping Sites into Jekyll 124 Jekyll Scraping Tactics 125 Writing our Parser 128 Publishing our blog to GitHub 148 Summary 148 www.it-ebooks.info For your next project on GitHub, take advantage of the service's powerful API to meet your unique development requirements. This practical guide shows you how to build your own software tools for customizing the GitHub workflow. Each hands-on chapter is a compelling story that walks you through the tradeoffs and considerations for building applications on top of various GitHub technologies. If you're an experienced programmer familiar with GitHub, you'll learn how to build tools with the GitHub API and related open source technologies such as Jekyll (site builder), Hubot (NodeJS chat robot), and Gollum (wiki). Build a simple Ruby server with Gist API command-line tools and Ruby's "Octokit" API client. Use the Gollum command-line tool to build an image management application. Build a GUI tool to search GitHub with Python. Document interactions between third-party tools and your code. Use Jekyll to create a fully-featured blog from material in your GitHub repository. Create an Android mobile application that reads and writes information into a Jekyll repository. Host an entire single-page JavaScript application on GitHub. Use Hubot to automate pull request reviews