sorted 48h feed by timestamp
This commit is contained in:
@@ -60,6 +60,7 @@ def create_25_recent_feed(df):
|
|||||||
write_file("RSS/recent_25.xml", XML_BEGIN_RECENT+latest_25_xml+XML_END)
|
write_file("RSS/recent_25.xml", XML_BEGIN_RECENT+latest_25_xml+XML_END)
|
||||||
|
|
||||||
def create_48h_latest(df):
|
def create_48h_latest(df):
|
||||||
|
last_48_hours = df.sort_values("timestamp", ascending=False)
|
||||||
last_48_hours = df[df['timestamp'] > datetime.now() - pd.Timedelta(days=2)]
|
last_48_hours = df[df['timestamp'] > datetime.now() - pd.Timedelta(days=2)]
|
||||||
last_48_xml = "\n".join([make_torrent_entry(i[0], i[1], i[3]) for i in last_48_hours.values])
|
last_48_xml = "\n".join([make_torrent_entry(i[0], i[1], i[3]) for i in last_48_hours.values])
|
||||||
write_file("RSS/latest_48h.xml", XML_BEGIN_LAST+last_48_xml+XML_END)
|
write_file("RSS/latest_48h.xml", XML_BEGIN_LAST+last_48_xml+XML_END)
|
||||||
|
|||||||
Reference in New Issue
Block a user