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
function doPost(e) { | |
// get the parameters | |
var params = e.parameter | |
// run if command sends request | |
if (params.call == "command") { | |
// create payload | |
var trigger_id = params.trigger_id |
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
import requests as rq | |
import pandas as pd | |
channel_url = 'https://slack.com/api/conversations.list' | |
channel_headers = {'content-type': 'application/x-www-form-urlencoded'} | |
channel_params = { | |
'token': 'xoxp-XXXXXXXXXXXX-XXXXXXXXXXXX-XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | |
'limit': 1000, | |
'exclude_archived': True | |
} |
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
import requests as rq | |
import pandas as pd | |
msg_url = 'https://slack.com/api/conversations.history' | |
msg_headers = {'content-type': 'application/x-www-form-urlencoded'} | |
msg_params = { | |
'token': 'xoxp-XXXXXXXXXXXX-XXXXXXXXXXXX-XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | |
'channel': 'CXXXXXXXX', | |
'limit': 1000 | |
} |
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
emj_data = [] | |
for m in msg: | |
url = 'https://slack.com/api/reactions.get' | |
head = {'content-type': 'application/x-www-form-urlencoded'} | |
params = { | |
'token': 'xoxp-XXXXXXXXXXXX-XXXXXXXXXXXX-XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | |
'channel': 'CXXXXXXXX', | |
'timestamp': m | |
} | |
res = rq.get(url=url, headers=head, params=params) |
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
import pandas as pd | |
import json | |
from datetime import datetime, timezone | |
# Function to convert date to Apple epoch time | |
def to_apple_epoch(date_str): | |
dt = datetime.strptime(date_str, "%Y-%m-%d") | |
apple_epoch = datetime(2001, 1, 1, tzinfo=timezone.utc) | |
delta = dt.replace(tzinfo=timezone.utc) - apple_epoch | |
return int(delta.total_seconds()) |
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
""" | |
Script to process a Takeout export of a Google Photos album based on HTML source code. | |
This is a very hacky solution to the non-existent possibility of exporting Google Photos | |
albums in the order set in the UI. | |
The code takes the folder, parses the corresponding JSON files, extracts URL IDs, finds their order | |
in an HTML source code file, and copies & renames the photos with a prefixed counter based on the order. | |
Usage: |