1.底

       项目要求,征求github的repo的api,为了能够提取repo对数据进行分析。

研究一天。最终克服该问题,較低下。

    由于github的那个显示repo的api,列出了每一个repo的具体信息。并且是json格式的。如今貌似还没有找到能够分析多个json格式数据的方法,所以用的是比較蠢得splite加re的方法。假设大家有更好的方法,不发留言讨论!
  

2.代码

import re
import os def GetUrl(num):
str = os.popen("curl -G https://api.github.com/repositories?since=%d"%(num)).read()
pattern = '"url"'
pattern1='repos'
urls=str.split(',\n')
for i in urls:
if pattern in i and pattern1 in i: # text1=i.splite(':')
text=re.compile('"(.*?)"').findall(i)[1]
print text if __name__=='__main__':
GetUrl(1000)

当中num的值指的是页面的id,我们能够做一个循环,不断增大num的值,就能够无限提取repo。由于github的api对于流量是有限制的,所以这么做是一个可行的方法。

效果例如以下(提取下来的repo的api地址):

https://api.github.com/repos/wycats/merb-core

https://api.github.com/repos/rubinius/rubinius

https://api.github.com/repos/mojombo/god

https://api.github.com/repos/vanpelt/jsawesome

https://api.github.com/repos/wycats/jspec

https://api.github.com/repos/defunkt/exception_logger

https://api.github.com/repos/defunkt/ambition

https://api.github.com/repos/technoweenie/restful-authentication

https://api.github.com/repos/technoweenie/attachment_fu

https://api.github.com/repos/topfunky/bong

https://api.github.com/repos/Caged/microsis

https://api.github.com/repos/anotherjesse/s3

https://api.github.com/repos/anotherjesse/taboo

https://api.github.com/repos/anotherjesse/foxtracs

https://api.github.com/repos/anotherjesse/fotomatic

https://api.github.com/repos/mojombo/glowstick

https://api.github.com/repos/defunkt/starling

https://api.github.com/repos/wycats/merb-more

https://api.github.com/repos/macournoyer/thin

https://api.github.com/repos/jamesgolick/resource_controller

https://api.github.com/repos/jamesgolick/markaby

https://api.github.com/repos/jamesgolick/enum_field

https://api.github.com/repos/defunkt/subtlety

https://api.github.com/repos/defunkt/zippy

https://api.github.com/repos/defunkt/cache_fu

https://api.github.com/repos/KirinDave/phosphor

   

版权声明:本文博主原创文章,博客,未经同意不得转载。

python 弄github代码库列表的更多相关文章

  1. 我的github代码库

    我的github代码库地址:https://github.com/gooree.Enjoy coding,enjoy sharing.

  2. clone github代码库很慢,如何提速

    博主,最近在搭建hyperledger fabric的环境,其中有一步就是clone github上的代码,但是在过程中发现clone是真的慢. 为此google了一圈,发一现一个好用的办法: 1.登 ...

  3. 如何快速查看github代码库中第一次commit的记录

    发现一个别人推荐的代码库用来学习源码, star星还不少,别人推荐从第一次commit开始阅读,于是试着去找commits的第一次 问题来了,这个代码库commits7855次,点击进入commits ...

  4. day-2 如何搭建一个github代码库

    最近在听尤瓦尔·赫拉利代写的两本书<人类简史>和<未来简史>两本书评,一部描述人类从哪里来,一部描述人类将往哪里去,书中阐述以前我们经历的饥饿.疾病和战争已经渐渐逝去,未来我们 ...

  5. (转)Eclipse配置GitHub代码库(以Windows7为例)

    原文地址:http://blog.csdn.net/twlkyao/article/details/26340685 1.安装Git 首先安装git.这里只讲Windows环境下安装Git方法. 从G ...

  6. 拆招黑客!github代码库大牛们如何应对黑客攻击

    2019年05月,<个人电脑杂志>网站报道,GitHub(2018年被微软收购)代码库正遭到一名黑客的入侵(392个资源库受损,约1000名用户受到攻击,真实资料未知).据称,这名黑客先擦 ...

  7. 创建自己的github代码库

    前提: 1.安装git 2.在github上创建一个repository(库),如名字叫Hello-World,则git地址为https://github.com/username/Hello-Wor ...

  8. 破解jar包5步搞定,jira7.9.2操作成功,附github代码库

    1,从要破解的程序中拷贝.jar包文件,运行1_jar.sh将其解压.以jira7.9.2为例: $install_dir\JIRA\atlassian-jira\WEB-INF\lib\atlass ...

  9. 快速同步GitHub代码库

    因伟大的墙的存在,github下载速度奇慢, 简单办法,在csdn code建一个账号,然后创建工程的时候选择导入模式, 填入github的项目git URL. 然后.. 从csdn的code下载就快 ...

随机推荐

  1. Gunplot 命令大全

    在linux命令提示符下运行gnuplot命令启动,输入quit或q或exit退出. plot命令 gnuplot> plot sin(x) with line linetype 3 linew ...

  2. Redis的快照功能

    引言:  Redis是基于内存的数据库,同时也提供了若干持久化的方案,允许用户把内存中的数据,写入本地文件系统,以备下次重启或者当机之后继续使用.本文将描述如何基于Redis来设置这些功能. 快照的设 ...

  3. Linq to Entities不识别方法

    db.UserValidates.Include(a => a.User).Where(uv => u.UserValidates.Contains(uv, c)).ToList(); 执 ...

  4. AngularJs练习Demo10 ngInclude

    @{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport&quo ...

  5. 多重和嵌套if

    多重if实例: 看例子,内容不解释了! 隐藏行号 复制代码 ? 多重if import java.util.Scanner; public class 多重if{ public static void ...

  6. Java中关于OOM的场景及解决方法

    原文地址:http://developer.51cto.com/art/201112/305696.htm 1.OOM for Heap=>例如:java.lang.OutOfMemoryErr ...

  7. silverlight 生成图表 WCF 解析XML代码.svc.cs 文件

    silverlight 调用wcf 文件代码 private ListItem AnalyzeXML(string XMLCode, string Reportdate, string ChartNa ...

  8. redis之lua脚本

    背景介绍 redis数据库提供了一些管理功能比如 流水线:打包发送多条命令,并在一个回复里面接收所有被执行命令的结果.事务:一次执行多条命令,被执行的命令要么就全部都被执行,要么就一个也不执行.并且事 ...

  9. map和reduce

    map()函数接收两个参数,一个是函数,一个是Iterable,map将传入的函数依次作用到序列的每个元素,并把结果作为新的Iterator返回. map()传入的第一个参数是f,即函数对象本身.由于 ...

  10. java 编码转换

    在网络中爬取到的数据,编码可能与当前编译器的编码不相同,而导致可能产生显示乱码的问题.那么如何将网络的编码,转换为当前编译器认可的编码(一般为UTF-8),就是个问题了. 主要使用了两个方法: Str ...