Coder Social home page Coder Social logo

github_listener's Introduction

Github Listener

The simple library that calls user's registered functions whenever github events happen.

How to install

You can install Github Listener using pip :

$ pip install github_listener

Feature Support

  • Notification
  • ...If you have things you want, please tell me through issues.

Example

from github_listener import (
  GithubAccount,
  GithubListener,
)

account = GithubAccount("username", "password")
listener = GithubListener(account)

@listener.notification
def on_notification(change):
  # Do things that you want to do whenever the github's notification occurs.
  pass

listener.run()  # infinite loop
from github_listener import GithubAccount
from github_listener.github_api import NotificationAPI

account = GithubAccount("username", "password")
api = NotificationAPI(account)
groups = api.get_notification_groups()

# Do something using notification informations.

For more detail examples, Go Examples.

Contribution

Welcome any kind of contribution!

github_listener's People

Contributors

taeguk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

github_listener's Issues

Creating a listener causes a type error: TypeError: super() takes at least 1 argument (0 given)

account = GithubAccount("username", "password")
listener = GithubListener(account)
listener = GithubListener(account)
  File "/Library/Python/2.7/site-packages/github_listener/github_listener.py", line 49, in __init__
    self.event_checker = GithubEventChecker(account)
  File "/Library/Python/2.7/site-packages/github_listener/github_listener.py", line 32, in __init__
    self.notification_checker = NotificationChecker(account)
  File "/Library/Python/2.7/site-packages/github_listener/notification.py", line 35, in __init__
    self.notification_api = NotificationAPI(account)
  File "/Library/Python/2.7/site-packages/github_listener/github_api/notification_api.py", line 34, in __init__
    super().__init__(account)
TypeError: super() takes at least 1 argument (0 given)

Max retries exceeded with url: /notifications

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /notifications (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0xb6ba338c>: Failed to establish a new connection: [Errno -5] No address associated with hostname',))

Max retries exceeded with url: /session

This problem is caused from refusing my connection of Github Server.
What is the solutions...?

  1. Adjust time gap of requests to Github.
    Current, default time gap is 0.5 sec.
    If you adjust it, listener.run(time_gap)
  2. I have to think....

Can't use Gist with github_listener

Can't use Gist with github_listener....
A Unicorn appears.....:(

The problem is that github_listener login to github so much. (so many access to /session)
Related Issue is #1 .

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.