Skip to content

Instantly share code, notes, and snippets.

View gloriouslyawkwardlife's full-sized avatar

Steven Buehler gloriouslyawkwardlife

  • Clermont, Florida
View GitHub Profile
@gloriouslyawkwardlife
gloriouslyawkwardlife / Faceboook_to_DayOne2.ps1
Last active January 6, 2024 18:27
Retrieves Facebook history as entries into the Mac version of DayOne
#!/usr/local/bin/pwsh
$access_token="<INSERT FACEBOOK ACCESS TOKEN HERE: https://developers.facebook.com/tools/accesstoken/"
$data = invoke-restmethod "https://graph.facebook.com/v18.0/me/posts?fields=title,application,backdated_time,caption,child_attachments,id,coordinates,created_time,description,event,full_picture,message,name,object_id,parent_id,place,scheduled_publish_time,status_type,story,type,updated_time,attachments,comments,link,permalink_url,reactions&limit=100&access_token=$access_token" -ErrorAction Stop
while ($true) {
foreach ($p in $data.data) {
if ($p.backdated_time -ne $null) {
$posttime = $p.backdated_time.toString('s').replace('T', ' ')
}
else {