Initial commit
This commit is contained in:
commit
716894ad48
|
|
@ -0,0 +1,11 @@
|
|||
[[source]]
|
||||
name = "pypi"
|
||||
url = "https://pypi.org/simple"
|
||||
verify_ssl = true
|
||||
|
||||
[dev-packages]
|
||||
|
||||
[packages]
|
||||
facebook-sdk = "*"
|
||||
social-scheduler = {editable = true,path = "."}
|
||||
instagramapi = "*"
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
from sys import argv
|
||||
from social_scheduler.main import main
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(argv[1:])
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
import os
|
||||
from setuptools import setup
|
||||
|
||||
setup(
|
||||
name = "social-scheduler",
|
||||
version = "0.0.1",
|
||||
author = "Patrick Neff",
|
||||
author_email = "odie86@gmail.com",
|
||||
description = ('Posts to social media on a schedule'),
|
||||
license = "BSD",
|
||||
packages=['social_scheduler'],
|
||||
)
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
Metadata-Version: 1.2
|
||||
Name: social-scheduler
|
||||
Version: 0.0.1
|
||||
Summary: Posts to social media on a schedule
|
||||
Home-page: UNKNOWN
|
||||
Author: Patrick Neff
|
||||
Author-email: odie86@gmail.com
|
||||
License: BSD
|
||||
Description: UNKNOWN
|
||||
Platform: UNKNOWN
|
||||
Requires-Python: >= 3.6
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
README.md
|
||||
setup.cfg
|
||||
setup.py
|
||||
social_scheduler/__init__.py
|
||||
social_scheduler/__main__.py
|
||||
social_scheduler/main.py
|
||||
social_scheduler/scheduler.py
|
||||
social_scheduler.egg-info/PKG-INFO
|
||||
social_scheduler.egg-info/SOURCES.txt
|
||||
social_scheduler.egg-info/dependency_links.txt
|
||||
social_scheduler.egg-info/top_level.txt
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -0,0 +1 @@
|
|||
social_scheduler
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
from .main import main
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,7 @@
|
|||
from sys import exit
|
||||
|
||||
from .scheduler import run_scheduler
|
||||
|
||||
|
||||
def main(args):
|
||||
exit(run_scheduler())
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
from .workers.instagram import InstagramWorker
|
||||
from .workers.facebook import FacebookWorker
|
||||
|
||||
|
||||
def run_scheduler():
|
||||
#facebook = FacebookWorker('', '')
|
||||
#instagram = InstagramWorker('', '')
|
||||
Binary file not shown.
|
|
@ -0,0 +1,12 @@
|
|||
import facebook
|
||||
|
||||
|
||||
class FacebookWorker(object):
|
||||
def __init__(self, page_id, oauth_access_token):
|
||||
self.page_id = page_id
|
||||
self.oauth_access_token = oauth_access_token
|
||||
self.api = facebook.GraphAPI(self.oauth_access_token)
|
||||
|
||||
def post(self, image, caption):
|
||||
with open(image, 'rb') as photo:
|
||||
self.api.put_object(self.page_id, 'photos', message=caption, source=photo.read())
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
from InstagramAPI import InstagramAPI
|
||||
|
||||
|
||||
class InstagramWorker(object):
|
||||
def __init__(self, username, password):
|
||||
self.api = InstagramAPI(username, password)
|
||||
self.api.login()
|
||||
|
||||
def post(self, image, caption):
|
||||
self.api.uploadPhoto(image, caption)
|
||||
Loading…
Reference in New Issue