{"id":13680909,"url":"https://github.com/niklas-heer/pocketcasts-stats","last_synced_at":"2025-05-12T04:32:04.307Z","repository":{"id":33460637,"uuid":"145129005","full_name":"niklas-heer/pocketcasts-stats","owner":"niklas-heer","description":"This project let's you fetch your Pocket Casts statistics and put them into Airtable with about 80 lines of code.","archived":false,"fork":false,"pushed_at":"2025-05-11T13:54:07.000Z","size":238,"stargazers_count":20,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-11T14:42:14.375Z","etag":null,"topics":["airtable","docker","gitlab-ci","pocketcasts","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niklas-heer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-08-17T14:14:10.000Z","updated_at":"2025-01-16T09:01:14.000Z","dependencies_parsed_at":"2023-02-15T16:45:29.957Z","dependency_job_id":"510ab138-0da2-4486-a1fb-5f22d29989ab","html_url":"https://github.com/niklas-heer/pocketcasts-stats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklas-heer%2Fpocketcasts-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklas-heer%2Fpocketcasts-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklas-heer%2Fpocketcasts-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklas-heer%2Fpocketcasts-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niklas-heer","download_url":"https://codeload.github.com/niklas-heer/pocketcasts-stats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253675551,"owners_count":21945940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airtable","docker","gitlab-ci","pocketcasts","python"],"created_at":"2024-08-02T13:01:23.656Z","updated_at":"2025-05-12T04:32:04.012Z","avatar_url":"https://github.com/niklas-heer.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"![PocketCasts statistics](https://raw.github.com/niklas-heer/pocketcasts-stats/master/.github/img/screenshot_01.png \"Airtable Dashboard\")\n\n\u003ch2 align=\"center\"\u003ePocket Casts statistics\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca class=\"badge-align\" href=\"https://www.codacy.com/app/niklas-heer/pocketcasts-stats?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=niklas-heer/pocketcasts-stats\u0026amp;utm_campaign=Badge_Grade\"\u003e\u003cimg src=\"https://api.codacy.com/project/badge/Grade/c731b48a33194913a4a8e49b5ca4b008\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/ambv/black\"\u003e\u003cimg alt=\"Code style: black\" src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://travis-ci.org/niklas-heer/pocketcasts-stats\"\u003e\u003cimg alt=\"Build Status\" src=\"https://travis-ci.org/niklas-heer/pocketcasts-stats.svg?branch=master\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/niklas-heer/pocketcasts-stats\"\u003e\u003cimg src=\"https://codecov.io/gh/niklas-heer/pocketcasts-stats/branch/master/graph/badge.svg\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://pyup.io/repos/github/niklas-heer/pocketcasts-stats/\"\u003e\u003cimg src=\"https://pyup.io/repos/github/niklas-heer/pocketcasts-stats/shield.svg\" alt=\"Updates\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"License: MIT\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nThis project lets you fetch your Pocket Casts statistics and put them into Airtable with [about 80 lines](#lines-of-code) of code. :tada:\n\n## Configuration\n\n### Airtable\n\nFor the tool to work you'll need a [free Airtable account](https://airtable.com/invite/r/V2q23fXk). If you don't have one - [make one](https://airtable.com/invite/r/V2q23fXk).\n\n1.  Go to this example base: \u003chttps://airtable.com/shryxs3YOERmBeHl1\u003e\n\n2.  Click on `Copy base` in the top right corner\n\n3.  Once copied delete the records\n\n4.  Click on your profile picture in the top right corner\n\n5.  Select `Account`\n\n6.  On the page click on `Generate API key` on the right side under API\n\n    -   Save the key and use it later for the `AIRTABLE_API_KEY` key\n\n7.  Go to this page and select your copied base: \u003chttps://airtable.com/api\u003e\n\n8.  Select `AUTHENTICATION` on the left side\n\n9.  On the right side there should be a dark area with text looking like this:\n\n    -   `$ curl https://api.airtable.com/v0/appr9hgXPZbBPqV4n/PocketCasts?api_key=YOUR_API_KEY`\n    -   Save the part between the alphanumeric string for later use (here it would be `appr9hgXPZbBPqV4n`)\n    -   The saved string will be used as `AIRTABLE_BASE_ID`\n\n10. Follow the next steps\n\n### Gitlab\n\nFor this to work you'll need a free Gitlab.com account. If you don't have one - make one.\n\n1.  Make a new project on [Gitlab.com](https://gitlab.com).\n\n2.  Import this repository as the base for your project.\n\n3.  Setup all environment variables in the project.\n\n    -   Go to `Settings` \u003e `CI / CD` (on the left)\n\n    -   Insert variables under `Variables` (click expand, also see `Environment variables`)\n\n4.  Setup the Pipeline Scheduler\n\n    -   Go to `CI / CD` \u003e `Schedules` (on the left)\n\n    -   Click the green button on the right `New schedule`\n\n    -   Give it a description (eg. \"Get new stats every 2h\")\n\n    -   Select `Custom ( Cron syntax )` under `Interval Pattern`\n    -   Insert the following into the field: `0 */2 * * *` (runs every 2 hours)\n    -   Make sure under `Target Branch` you selected your `master` branch\n    -   Make sure the checkbox `Active` is checked\n    -   Click the `Save pipeline schedule`\n\n5.  Profit! :)\n\n### Environment variables\n\n-   `POCKETCASTS_EMAIL` - the email address of your PocketCasts login\n-   `POCKETCASTS_PASSWORT` - the password to login to PocketCasts\n-   `AIRTABLE_BASE_ID` - the ID of the Airtable base which is used to store the data\n-   `AIRTABLE_API_KEY` - your account API key to access Airtable\n-   `AIRTABLE_POCKETCASTS_TABLE` - the table to store the PocketCasts information in\n\n**IMPORTANT**: You cannot use special characters like `.!$/\\|` symbols in the environment variables!\n\n## Local testing\n\n1.  Make a copy of the `.env_example` file and name it `.env`\n2.  Put in your credentials as mentioned in **Environment variables**\n3.  Test the app via docker with: `make`\n4.  Profit! :)\n\n## Contribution\n\nPlease make sure you run [`black`](https://github.com/ambv/black) on your code before you commit it!\n\n## Lines of code\n\nThis project uses about 80 lines of code according to [`cloc`](https://github.com/AlDanial/cloc):\n\n    ➜ cloc app.py .gitlab-ci.yml\n           2 text files.\n           2 unique files.\n           0 files ignored.\n\n    github.com/AlDanial/cloc v 1.80  T=0.01 s (157.1 files/s, 12570.7 lines/s)\n    -------------------------------------------------------------------------------\n    Language                     files          blank        comment           code\n    -------------------------------------------------------------------------------\n    Python                           1             28             43             70\n    YAML                             1              4              0             15\n    -------------------------------------------------------------------------------\n    SUM:                             2             32             43             85\n    -------------------------------------------------------------------------------\n\n## Attribution\n\n-   [Pocket Casts](https://www.pocketcasts.com/) for being an awesome podcast player!\n-   [airtable-python-wrapper](https://github.com/gtalarico/airtable-python-wrapper) as an awesome library to connect to Airtable\n-   [furgoose/Pocket-Casts](https://github.com/furgoose/Pocket-Casts) as a good reference how to query the PocketCasts \"API\"\n-   [Airtable](https://airtable.com/invite/r/V2q23fXk) for being just an awesome tool!\n-   [Gitlab](https://gitlab.com) and `GitlabCI` for being an all in one solution\n-   Gitlab Scheduler for Pipelines because without it you would need a server.\n-   [gitmoji](https://gitmoji.carloscuesta.me/) for better understandable commits through emojis. :tada:\n-   [pylama](https://github.com/klen/pylama) for checking the code quality.\n-   [pytest](https://github.com/pytest-dev/pytest) for being an awesome testing framework.\n-   [pytest-cov](https://github.com/pytest-dev/pytest-cov) for generating coverage reports.\n-   [black](https://github.com/ambv/black) as an awesome code formatter for Python.\n-   [Travis CI](https://travis-ci.org/niklas-heer/pocketcasts-stats) for being a nice tool for CIs on Github. 👷\n-   [codecov](https://codecov.io) for showing the code coverage and help improve it.\n-   [pyup](https://pyup.io/) for helping to keep this project secure.\n-   [codacy](https://app.codacy.com) for helping improving the code quality.\n\n[ ~ Dependencies scanned by PyUp.io ~ ]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklas-heer%2Fpocketcasts-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklas-heer%2Fpocketcasts-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklas-heer%2Fpocketcasts-stats/lists"}