Skip to main content

A Facebook Crowdtangle Client

Project description

DBoeS-stats

Collectors of reputation metrics of public speakers in social media platforms

About

The Facebook directory-

  1. extracts posts of accounts and creates individual folders containing JSON response for every account (get_posts.py).
  2. extracts content from CrowdTangle and creates CSV files containing the statistics of facebook pages (get_list.py).

Storing API Access Token

Store your API access token in a python file, name it Access_Token.py and save it in the DBoeS-stats directory. In the file store the access token as:

access_token = "API access token generated from your crowd tangle account"

Installation

  1. Install poetry
  2. Clone repository
  3. In the directory run poetry install
  4. Run poetry shell to start development virtualenv
  5. Run factli.

Cloning this Repo

To clone this repository type:

git clone https://github.com/Leibniz-HBI/DBoeS-stats.git

Usage

usage: factli [OPTIONS]

Options:
  --list_id TEXT       Saved List ID
  --count INTEGER      Number of posts returned per call, maximum 100,
                       defaults to 10
  --access_token TEXT  Your unique access token
  --start_date TEXT    Start Date (older), Format=YYYY-MM-DD, if not given
                       defaults to NULL
  --end_date TEXT      End Date(newer), Format=YYYY-MM-DD, if not given
                       defaults to current date
  --time_frame TEXT    The interval of time to consider from the endDate. Any
                       valid SQL interval, eg: "1 HOUR" or "30 MINUTE"
  --log_level TEXT     Level of output detail (DEBUG, INFO, WARNING, ERROR).
                       Warnings and Errors are               always logged in
                       respective log-files `errors.log` and `warnings.log`.
                       Default: ERROR
  --log_file TEXT      Path to logfile. Defaults to standard output.
  --sched TEXT         If given, waits "sched" hour(s) and then repeats.
  --notify TEXT        If given, notify email address in case of unexpected
                       errors. Needs further setup. See README.
  --path TEXT          If given, stores the output at the desired location
                       (Absolute Path needed)
  --help               Show this message and exit.

Email notifications with the -n argument use yagmail.

Output

Output of get_posts.py stores the raw JSON response in the following folder structure:

Facebook/results/list_id/account_id/start-date_end-date.json

An example of the JSON data can be viewed here.

Ensure that factli is continuously running, even after restart

If your system can run cronjobs, stop twacapic, run crontab -e and add the following to your crontab:

30 6 * * *    sh -c "cd PATH/TO/YOUR/DBoeS-stats/WORKING/DIRECTORY && PATH/TO/Poetry-env run factli [YOUR ARGUMENTS HERE]" >> out.txt 2>&1

This will start collection at 0630Hr (GMT) everyday.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

factli-0.2.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

factli-0.2.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file factli-0.2.0.tar.gz.

File metadata

  • Download URL: factli-0.2.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.8.10 Linux/5.10.102.1-microsoft-standard-WSL2

File hashes

Hashes for factli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 75b1ca3c1d304fecad9ba852a1bcfac0a435f6d79108cc4cbf70a5a959676f08
MD5 e10c88f2ba356bbd699a20dbddaee0f8
BLAKE2b-256 e1e7d982b5afc6688be9ad7da06530df915cbff975141058428e631091369fe9

See more details on using hashes here.

File details

Details for the file factli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: factli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.8.10 Linux/5.10.102.1-microsoft-standard-WSL2

File hashes

Hashes for factli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c99fe5d2678fe2e52ee66eaabfaa086992360d8d0c88022a0c4227f9d21c61a0
MD5 032e47909e895189381fda7e2c12266a
BLAKE2b-256 f2a89c1f96f62181f09805c008df389fe8b573046325785b25b68ad5c4330429

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page