This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am sido378 on github. | |
* I am sido378 (https://keybase.io/sido378) on keybase. | |
* I have a public key ASCLSeTagPti7pNdaIau60RkedcC1r6y0hsWpGxbsbp9dwo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns facebook-example.database | |
(:gen-class) | |
(:require [clojure.java.io :as io] | |
[clojure.data.json :as json])) | |
(defn load-db [] | |
(if-let [data (slurp (io/file (io/resource "database.json")))] | |
(try (json/read-str data :key-fn keyword) | |
(catch Exception e {})))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## alte lösung, funzt nicht: | |
data = { | |
"recipient[id]": recipient_id, | |
"message[attachment][type]": "image", | |
"message[attachment][payload][]": "" | |
} | |
items = [] | |
for name, value in data.items(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import json, urllib | |
from flask import Flask, request, abort | |
import requests | |
from pymessenger.bot import Bot | |
from pprint import pprint | |
DB_FILE = "data.json" | |
access_token = 'ACCESS_TOKEN' |