Initial struture

This commit is contained in:
Phil Gyford
2019-04-15 18:05:14 +01:00
parent 91ec3a43df
commit 79d696fa22
6 changed files with 124 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
config.ini

12
Pipfile Normal file
View File

@@ -0,0 +1,12 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
foursquare = "*"
[dev-packages]
[requires]
python_version = "3.7"

71
Pipfile.lock generated Normal file
View File

@@ -0,0 +1,71 @@
{
"_meta": {
"hash": {
"sha256": "29dee3b8e3acad4b57ba9395b14419cca49fccede2ea2a7dd41d9375776c0983"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.7"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.org/simple",
"verify_ssl": true
}
]
},
"default": {
"certifi": {
"hashes": [
"sha256:59b7658e26ca9c7339e00f8f4636cdfe59d34fa37b9b04f6f9e9926b3cece1a5",
"sha256:b26104d6835d1f5e49452a26eb2ff87fe7090b89dfcaee5ea2212697e1e1d7ae"
],
"version": "==2019.3.9"
},
"chardet": {
"hashes": [
"sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae",
"sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"
],
"version": "==3.0.4"
},
"foursquare": {
"hashes": [
"sha256:339c95bd644cb18a622b7bdd2f5719354b46be8765bb545f5fa1862d91450e27",
"sha256:bd58725ec2a394cd01d2621099e91a6b15a49daad2d57ed732985b201da5021a"
],
"index": "pypi",
"version": "==1!2019.2.16"
},
"idna": {
"hashes": [
"sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407",
"sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c"
],
"version": "==2.8"
},
"requests": {
"hashes": [
"sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e",
"sha256:7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b"
],
"version": "==2.21.0"
},
"six": {
"hashes": [
"sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c",
"sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"
],
"version": "==1.12.0"
},
"urllib3": {
"hashes": [
"sha256:61bf29cada3fc2fbefad4fdf059ea4bd1b4a86d2b6d15e1c7c0b582b9752fe39",
"sha256:de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22"
],
"version": "==1.24.1"
}
},
"develop": {}
}

2
README.md Normal file
View File

@@ -0,0 +1,2 @@
# Foursquare Feeds

4
config_example.ini Normal file
View File

@@ -0,0 +1,4 @@
[Foursquare]
ClientID=yourIDhere
ClientSecret=yourSecretHere

34
generate_feeds.py Executable file
View File

@@ -0,0 +1,34 @@
import configparser
import logging
logging.basicConfig(level=logging.INFO, format="%(message)s")
logger = logging.getLogger(__name__)
CONFIG_FILE = "config.ini"
class FeedGenerator:
def __init__(self):
self._load_config(CONFIG_FILE)
def _load_config(self, config_file):
config = configparser.ConfigParser()
try:
config.read_file(open(config_file))
except IOError:
logger.critical("Can't read config file: " + config_file)
exit()
self.api_id = config.get("Foursquare", "ClientID")
self.api_secret = config.get("Foursquare", "ClientSecret")
def generate(self):
logger.info("GENERATE")
if __name__ == "__main__":
generator = FeedGenerator()
generator.generate()