we have fixed the date stamp now
This commit is contained in:
parent
6c4eaaa764
commit
99c1579137
@ -5,7 +5,7 @@ config({"development", "production"}, {
|
|||||||
postgres = {
|
postgres = {
|
||||||
host = "postgres",
|
host = "postgres",
|
||||||
user = "postgres",
|
user = "postgres",
|
||||||
-- password = "the_password",
|
password = "the_password",
|
||||||
database = "postgres"
|
database = "postgres"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -70,35 +70,19 @@ local function Splhandler(self)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- we have to split the `hr:min:sec` and `month/day/year` strings from SPL
|
-- we have to split the `hr:min:sec` and `year-month-day` strings from SPL
|
||||||
-- and since SPL uses both "." and "-" for dates .. somehow .. we have to do more dirty tricks ..
|
local function Split(s, delimiter)
|
||||||
local function Split(s, delimiters)
|
local result = {}
|
||||||
|
for match in (s..delimiter):gmatch("(.-)"..delimiter) do
|
||||||
for i, delimiter in ipairs(delimiters) do
|
table.insert(result, match)
|
||||||
local result = {}
|
|
||||||
|
|
||||||
if delimiter == "." then
|
|
||||||
for match in string.gmatch(s, "[^%.]+") do
|
|
||||||
table.insert(result, match)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
for match in (s..delimiter):gmatch("(.-)"..delimiter) do
|
|
||||||
table.insert(result, match)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if table.getn(result) == 3 then
|
|
||||||
return result
|
|
||||||
else
|
|
||||||
print("something is wrong: ".. s)
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
local split_airtime = Split(airtime, {":"})
|
|
||||||
|
local split_airtime = Split(airtime, ":")
|
||||||
local airtime_hr, airtime_min, airtime_sec = split_airtime[1], split_airtime[2], split_airtime[3]
|
local airtime_hr, airtime_min, airtime_sec = split_airtime[1], split_airtime[2], split_airtime[3]
|
||||||
local split_airdate = Split(airdate, {"/", ".", "-"})
|
local split_airdate = Split(airdate, "-")
|
||||||
local airdate_year, airdate_month, airdate_day = split_airdate[1], split_airdate[2], split_airdate[3]
|
local airdate_year, airdate_month, airdate_day = split_airdate[1], split_airdate[2], split_airdate[3]
|
||||||
local airtime_stamp = os.time{year=airdate_year, month=airdate_month, day=airdate_day, hour=airtime_hr, min=airtime_min, sec=airtime_sec}
|
local airtime_stamp = os.time{year=airdate_year, month=airdate_month, day=airdate_day, hour=airtime_hr, min=airtime_min, sec=airtime_sec}
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,12 @@ ignore_tags = [
|
|||||||
"XLastScheduled", "EAN/UPC", "Comment", "Record Date", "XEndDate", "XRestrictions"
|
"XLastScheduled", "EAN/UPC", "Comment", "Record Date", "XEndDate", "XRestrictions"
|
||||||
]
|
]
|
||||||
|
|
||||||
query_params = {}
|
host = 'http://localhost:8082'
|
||||||
|
# host = 'https://tracks.intergalactic.fm'
|
||||||
|
|
||||||
|
query_params = {
|
||||||
|
# "secret": "secret"
|
||||||
|
}
|
||||||
|
|
||||||
if len(sys.argv) <= 1:
|
if len(sys.argv) <= 1:
|
||||||
sys.exit("no argument passed")
|
sys.exit("no argument passed")
|
||||||
@ -60,7 +65,7 @@ for item in ape.tag.frames:
|
|||||||
# print(Y,M,D,h,m,s)
|
# print(Y,M,D,h,m,s)
|
||||||
|
|
||||||
time_list.append("{}:{}:{}".format(h, m, s))
|
time_list.append("{}:{}:{}".format(h, m, s))
|
||||||
date_list.append("{}/{}/{}".format(M, D, Y))
|
date_list.append("{}-{}-{}".format(Y, M, D))
|
||||||
elif key == "Other":
|
elif key == "Other":
|
||||||
query_params["country"] = value.decode()
|
query_params["country"] = value.decode()
|
||||||
elif key == "Year":
|
elif key == "Year":
|
||||||
@ -88,7 +93,7 @@ while i < len(time_list):
|
|||||||
# print(query_params)
|
# print(query_params)
|
||||||
|
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
'http://localhost:8082/spl/1',
|
'{}/spl/1'.format(host),
|
||||||
params=query_params
|
params=query_params
|
||||||
)
|
)
|
||||||
# print(response)
|
# print(response)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user