trexhere commited on
Commit
b677bde
1 Parent(s): 7514ed6

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -31
app.py DELETED
@@ -1,31 +0,0 @@
1
- import gradio as gr
2
- import requests
3
- import os
4
-
5
- def invite_user(username):
6
- GITHUB_TOKEN = os.getenv('GITHUB_TOKEN')
7
- GITHUB_ORG = os.getenv('GITHUB_ORG')
8
- response = requests.post(
9
- f'https://api.github.com/orgs/{GITHUB_ORG}/invitations',
10
- headers={
11
- 'Authorization': f'token {GITHUB_TOKEN}',
12
- 'Accept': 'application/vnd.github.v3+json',
13
- 'Content-Type': 'application/json',
14
- },
15
- json={'invitee_id': username}
16
- )
17
-
18
- if response.ok:
19
- return f'Invitation sent to {username}'
20
- else:
21
- return f'Error: {response.json().get("message", "Unknown error")}'
22
-
23
- iface = gr.Interface(
24
- fn=invite_user,
25
- inputs='text',
26
- outputs='text',
27
- title='Join AccioINTERN'
28
- )
29
-
30
- if __name__ == "__main__":
31
- iface.launch()