Exemplo n.º 1
0
def github_issues():
    if settings.DEBUG:
        return 
    from github.utils import get_issues, get_user
    repos = []

    for org in ['bitcoin', 'gitcoinco', 'ethereum']:
        for repo in get_user(org, '/repos'):
            repos.append((org, repo['name']))

    for org, repo in repos:
        issues = []
        cont = True
        page = 1
        while cont:
            new_issues = get_issues(org, repo, page, 'all')
            issues = issues + new_issues
            page += 1
            cont = len(new_issues)

        val = len(issues)
        key = f"github_issues_{org}_{repo}"
        try:
            Stat.objects.create(
                created_on=timezone.now(),
                key=key,
                val=(val),
                )
        except Exception:
            pass
        if not val:
            break
Exemplo n.º 2
0
    def handle(self, *args, **options):

        known_repos = [('JGcarv', 'ethereum-bounty-hunters')]

        for owner, repo in known_repos:
            issues = get_issues(owner, repo)
            for bounty in issues:
                payout_str = ''
                try:
                    ExternalBounty.objects.get_or_create(
                        action_url=bounty['url'],
                        active=True,
                        description=bounty['body'],
                        source_project=repo,
                        amount=None,
                        amount_denomination='',
                        tags=[repo],
                        title=bounty['title'],
                        payout_str=payout_str,
                    )
                except Exception as e:
                    print(e)
Exemplo n.º 3
0
def github_issues():
    from django.utils import timezone
    from datetime import datetime
    from marketing.models import Stat
    from github.utils import get_issues, get_user
    import pytz

    repos = [
    ]

    for org in ['bitcoin', 'gitcoinco', 'ethereum']:
        for repo in get_user(org, '/repos'):
            repos.append((org, repo['name']))

    for org, repo in repos:
        issues = []
        cont = True
        page = 1
        while cont:
            new_issues = get_issues(org, repo, page, 'all')
            issues = issues + new_issues
            page += 1
            cont = len(new_issues)

        val = len(issues)
        key = f"github_issues_{org}_{repo}"
        try:
            Stat.objects.create(
                created_on=timezone.now(),
                key=key,
                val=(val),
                )
        except:
            pass
        if not val:
            break
        print(key, val)