forked from hawkthorne/hawkthorne-journey
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b29027
commit 2e37b47
Showing
8 changed files
with
66 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ src/maps/*.lua | |
venv | ||
tmx2lua* | ||
release.md | ||
src/conf.lua.bak |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import os | ||
|
||
with open("src/conf.lua.bak") as f: | ||
conf = f.read() | ||
|
||
conf = conf.replace("t.release = false", | ||
"t.release = true") | ||
conf = conf.replace("ac1c2db50f1332444fd0cafffd7a5543", | ||
os.environ["MIXPANEL_TOKEN"]) | ||
|
||
with open("src/conf.lua", "w") as g: | ||
g.write(conf) |
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require "vendor/json" | ||
|
||
local mixpanel = {} | ||
local thread = nil | ||
local token = nil | ||
|
||
function mixpanel.init(t) | ||
thread = love.thread.newThread("mixpanel", "vendor/mixpanel_thread.lua") | ||
thread:start() | ||
token = t | ||
end | ||
|
||
function mixpanel.track(event, data) | ||
assert(thread, "Can't find the mixpanel thread") | ||
|
||
local data = data or {} | ||
data.token = token | ||
|
||
thread:set("point", json.encode({event=event, properties=data})) | ||
end | ||
|
||
return mixpanel |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
local http = require("socket.http") | ||
local mime = require("mime") | ||
|
||
local thread = love.thread.getThread() | ||
|
||
while true do | ||
local point = mime.b64(thread:demand("point")) | ||
local url = "http://api.mixpanel.com/track/?data=" .. point .. "&ip=1" | ||
local b, c, h = http.request(url) | ||
end |