Skip to content
Snippets Groups Projects
Commit c14298a0 authored by Timur's avatar Timur Committed by GitHub
Browse files

Merge pull request #2 from murych/stable

stable version
parents a4cbc4c6 292379f3
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -15,11 +15,4 @@ test:
- python config.py
- python auth.py
only:
- master
#post:
# stage: test
# script:
# - python main.py &
# - bash tests/post.sh
\ No newline at end of file
- tags
\ No newline at end of file
Loading
Loading
@@ -2,8 +2,6 @@ import facebook
from slacker import Slacker
from vk import Session, API
 
from config import bot_secret_
 
def auth_slack():
api = Slacker(bot_secret_)
Loading
Loading
@@ -24,19 +22,3 @@ def auth_vk():
print('vk not authed\n', e)
 
return api
def auth_facebook(cfg):
graph = facebook.GraphAPI(cfg['access_token'])
resp = graph.get_object('lambdafrela')
page_access_token = None
try:
if resp['id'] == cfg['page_id']:
page_access_token = cfg['access_token']
except KeyError:
print('not authed fb')
graph = facebook.GraphAPI(page_access_token)
return graph
name: slackvk
dependencies:
- openssl=1.0.2h=1
- pip=8.1.2=py35_0
- python=3.5.2=0
- readline=6.2=2
- setuptools=26.1.1=py35_0
- sqlite=3.13.0=0
- tk=8.5.18=0
- wheel=0.29.0=py35_0
- xz=5.2.2=0
- zlib=1.2.8=3
- pip:
- blessings==1.6
- click==6.6
- curtsies==0.2.9
- flask==0.11.1
- greenlet==0.4.10
- gunicorn==19.6.0
- itsdangerous==0.24
- jinja2==2.8
- markupsafe==0.23
- pygments==2.1.3
- six==1.10.0
- slacker==0.9.25
- vk==2.0.2
- wcwidth==0.1.7
- werkzeug==0.11.11
from flask import Flask, abort, request, render_template
 
from auth import auth_facebook, auth_slack
from auth import auth_slack
from config import *
from message import *
 
app = Flask(__name__)
 
cfg = {
'page_id' : page_id_,
'access_token': access_token_
}
@app.route('/')
def index():
return render_template('index.html')
Loading
Loading
@@ -41,7 +35,5 @@ def callback():
 
slack = auth_slack()
 
facebook = auth_facebook(cfg=cfg)
if __name__ == '__main__':
app.run(host="0.0.0.0", port=5000)
Loading
Loading
@@ -15,7 +15,9 @@ class User(object):
author_link = 'https://vk.com/id' + str(self.user['uid'])
author_icon = self.user['photo_50']
 
return author_name, author_link, author_icon
# return author_name, author_link, author_icon
# returning nothing to provide anonymity
return None, None, None
 
 
class Group(object):
Loading
Loading
facebook-sdk
flask
slacker
vk
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment