- Machine Learning for Cybersecurity Cookbook
- Emmanuel Tsukerman
- 207字
- 2021-06-24 12:29:06
How it works...
We start by importing the PyGitHub library in Step 1 in order to be able to conveniently call the GitHub APIs. These will allow us to scrape and explore the universe of repositories. We also import the base64 module for decoding the base64 encoded files that we will be downloading from GitHub. Note that there is a rate limit on the number of API calls a generic user can make to GitHub. For this reason, you will find that if you attempt to download too many files in a short duration, your script will not get all of the files. Our next step is to supply our credentials to GitHub (step 2), and specify that we are looking for repositories with JavaScript, using the query='language:javascript' command. We enumerate such repositories matching our criteria of being associated with JavaScript, and if they do, we search through these for files ending with .js and create local copies (steps 3 to 6). Since these files are encoded in base64, we make sure to decode them to plaintext in step 7. Finally, we show you how to adjust the script in order to scrape other file types, such as Python and PowerShell (Step 8).
- 21天學通JavaScript
- 大數據專業英語
- CSS全程指南
- Apache Hive Essentials
- 數據庫原理與應用技術學習指導
- VMware Performance and Capacity Management(Second Edition)
- Maya 2012從入門到精通
- 現代機械運動控制技術
- Creo Parametric 1.0中文版從入門到精通
- Embedded Programming with Modern C++ Cookbook
- 單片機C語言應用100例
- 貫通Java Web開發三劍客
- 從零開始學Java Web開發
- 單片機技術項目化原理與實訓
- Learning Linux Shell Scripting