|
|
|
@ -6,9 +6,8 @@ const path = require('path'); |
|
|
|
const fs = require('fs').promises; |
|
|
|
const fs = require('fs').promises; |
|
|
|
const gm = require('gm').subClass({ imageMagick: true }); |
|
|
|
const gm = require('gm').subClass({ imageMagick: true }); |
|
|
|
|
|
|
|
|
|
|
|
const graphql_endpoint = 'https://www.facebook.com/api/graphql/'; |
|
|
|
import { graphql_endpoint } from './constants'; |
|
|
|
const facebook_event_url = (event_id) => |
|
|
|
import { page_events_url, event_url } from './logic'; |
|
|
|
`https://www.facebook.com/events/${event_id}/`; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const get_upcoming_events = pathOr( |
|
|
|
const get_upcoming_events = pathOr( |
|
|
|
null, |
|
|
|
null, |
|
|
|
@ -146,11 +145,11 @@ const argv = parse_args(process.argv.slice(2)); |
|
|
|
const page_ids = pathOr('', ['page_ids'], argv) |
|
|
|
const page_ids = pathOr('', ['page_ids'], argv) |
|
|
|
.split(',') |
|
|
|
.split(',') |
|
|
|
.filter((str) => str.length !== 0) |
|
|
|
.filter((str) => str.length !== 0) |
|
|
|
.map((page_id) => `https://www.facebook.com/${page_id}/events/`); |
|
|
|
.map(page_events_url); |
|
|
|
const event_ids = pathOr('', ['event_ids'], argv) |
|
|
|
const event_ids = pathOr('', ['event_ids'], argv) |
|
|
|
.split(',') |
|
|
|
.split(',') |
|
|
|
.filter((str) => str.length !== 0) |
|
|
|
.filter((str) => str.length !== 0) |
|
|
|
.map((event_id) => `https://www.facebook.com/events/${event_id}`); |
|
|
|
.map(event_url); |
|
|
|
|
|
|
|
|
|
|
|
const register_upcoming_events_listener = (endpoint, page) => { |
|
|
|
const register_upcoming_events_listener = (endpoint, page) => { |
|
|
|
let responses = []; |
|
|
|
let responses = []; |