Giter Site home page Giter Site logo

steal_piano's Introduction

【steal piano】GitHub偷情分析工具!

你是否有这样的困扰,有一天你的仓库被很多人加了star,但是你却不知道这些人都是从哪来的?

别担心,GitHub偷情分析工具帮你轻松解决问题!

原理

GitHub偷情分析工具透过分析star的时间以及他们之间的follow关系,可以推测出每个star大概是被谁吸引过来的。

就是把所有仓库的star事件按时间排序,然后看看每个star的三天之内,那个人的follower有没有也来star。

样例

可以看到每个人直接加星的数量,以及每个人吸引来的间接加星的数量——

bobby285271 直接: 2 间接: 7
BeautyYuYanli 直接: 4 间接: 7
akemimadoka 直接: 1 间接: 7
cubercsl 直接: 1 间接: 7
LoRexxar 直接: 1 间接: 7
miaotony 直接: 1 间接: 7
solstice23 直接: 5 间接: 8
outloudvi 直接: 2 间接: 8
VergeDX 直接: 6 间接: 8
Naville 直接: 1 间接: 8
LaoshuBaby 直接: 6 间接: 9
wfjsw 直接: 1 间接: 9
kagurazakayashi 直接: 1 间接: 10
Co2333 直接: 5 间接: 10
kirainmoe 直接: 3 间接: 11
Ir1d 直接: 1 间接: 11
nekohasekai 直接: 3 间接: 12
Konano 直接: 1 间接: 12
mzdluo123 直接: 4 间接: 15
Enter-tainer 直接: 2 间接: 16
ccloli 直接: 4 间接: 16
b1f6c1c4 直接: 2 间接: 22
memset0 直接: 3 间接: 37
lz233 直接: 13 间接: 48
SCLeoX 直接: 14 间接: 49

可视化

./img.webp

使用方法

首先你需要1个Python3.6以上版本,然后pip install -r requirements.txt

接口是这样——

def ember(token, , days=365, save_path='1.png'): 
    ...
  • token: 你要自己去GitHub设置的Personal access tokens里注册一个,然后复制回来。(不需要加权限,用来提高GitHub访问频率的限制)

  • : 你的名字,比如RimoChan。

  • days: 扫描过去多少天内的star记录。

  • save_path: 保存可视化图片路径。

为什么是偷情???

因为找到GitHub上谁最喜欢你之后,你就可以去和她偷情了!

不说了不说了,我要去和SCLeoX偷情了,就这样,大家88。

steal_piano's People

Contributors

rimochan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

steal_piano's Issues

运行报错

piano.py加了一行调用然后直接运行输出:

E:\GitHub\steal_piano>python piano.py
Traceback (most recent call last):
  File "piano.py", line 15, in <module>
    @disk_cache('./dc')
  File "D:\Software\Python\Python38-32\lib\site-packages\rimo_utils\cache.py", line 39, in disk_cache
    dump, load, ext = 协议[protocol]
KeyError: './dc'

python:3.8.2
os:win11 21H2

运行报错

运行日志如下:

34it [00:12,  2.67it/s]
Traceback (most recent call last):
  File "E:/Programming/githubhub/steal_piano/piano.py", line 67, in <module>
    ember('xxxxxxx', 'xxxxxx', save_path="aaaa.png")
  File "E:/Programming/githubhub/steal_piano/piano.py", line 39, in ember
    for i in tqdm(星表(我)):
  File "D:\Programming\Python\Python3.7\lib\site-packages\rimo_storage\cache.py", line 36, in 假func
    map[名字] = s
  File "D:\Programming\Python\Python3.7\lib\site-packages\rimo_storage\__init__.py", line 104, in __setitem__
    return super().__setitem__(k, self.serialize(v))
  File "D:\Programming\Python\Python3.7\lib\multiprocessing\synchronize.py", line 101, in __getstate__
    context.assert_spawning(self)
  File "D:\Programming\Python\Python3.7\lib\multiprocessing\context.py", line 356, in assert_spawning
    ' through inheritance' % type(obj).__name__
RuntimeError: RLock objects should only be shared between processes through inheritance

Process finished with exit code 1

应该是你的rimo_storage 产生的问题?这个报错是由 multiprocessing 模块抛出的,意味着在多进程环境下出现了问题。根据 traceback,问题发生在缓存模块 rimo_storage 中的 _好dict.__setitem__ 方法中。这个缓存模块使用了 multiprocessing 中的 RLock 对象,但是 RLock 对象不能够在多进程环境下直接共享,只能够通过继承来共享。

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.