All Projects → niklas-heer → pocketcasts-stats

niklas-heer / pocketcasts-stats

Licence: MIT license
This project let's you fetch your Pocket Casts statistics and put them into Airtable with about 80 lines of code.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to pocketcasts-stats

labhub
GitHub bot for using GitLab CI in OSS projects
Stars: ✭ 31 (+158.33%)
Mutual labels:  gitlab-ci
airtable local backup
Create local backups of airtable databases
Stars: ✭ 32 (+166.67%)
Mutual labels:  airtable
async-airtable
A lightweight npm package to handle working with the Airtable API.
Stars: ✭ 48 (+300%)
Mutual labels:  airtable
mysqlclient
the mysqlclient Docker image (based on python:3.8.5-alpine3.12) https://github.com/PyMySQL/mysqlclient-python
Stars: ✭ 20 (+66.67%)
Mutual labels:  gitlab-ci
gitlab-ci-pipeline-php
Gitlab CI pipeline for PHP applications
Stars: ✭ 24 (+100%)
Mutual labels:  gitlab-ci
gitlab-ci-android-fastlane
Docker image for building android apps on Gitlab CI
Stars: ✭ 25 (+108.33%)
Mutual labels:  gitlab-ci
travis-ci-latex-pdf
Overview of different methods to build LaTeX with GitHub Actions or Travis-CI (idea by @jackolney but completely rewritten by @PHPirates and contributors).
Stars: ✭ 113 (+841.67%)
Mutual labels:  gitlab-ci
nocodb
🔥 🔥 🔥 Open Source Airtable Alternative - turns any MySQL, Postgres, SQLite into a Spreadsheet with REST APIs.
Stars: ✭ 28,894 (+240683.33%)
Mutual labels:  airtable
airtable
Airtable API Client for Go
Stars: ✭ 25 (+108.33%)
Mutual labels:  airtable
next-semantic-ui-react
Next.js + SUIR tiny starter
Stars: ✭ 20 (+66.67%)
Mutual labels:  gitlab-ci
aws-autoscaling-gitlab-runner
CloudFormation template to deploy a GitLab Runner with auto-scaling on AWS.
Stars: ✭ 44 (+266.67%)
Mutual labels:  gitlab-ci
gitlab-ci-runner-marathon
A customized Docker image for running scalable GitLab CI runners on Marathon
Stars: ✭ 14 (+16.67%)
Mutual labels:  gitlab-ci
godot-cpp-ci
Docker image and Github Actions to automatically compile Godot C++ GDNative libraries.
Stars: ✭ 21 (+75%)
Mutual labels:  gitlab-ci
nikolovlazar.com
My personal site's repo built using Next.js, Chakra UI, MDX, Prisma, PlanetScale.
Stars: ✭ 126 (+950%)
Mutual labels:  airtable
airtabler
R interface to the Airtable API
Stars: ✭ 84 (+600%)
Mutual labels:  airtable
orservices
ORServices is an open source, smartphone-friendly directory application that enables you to collect, verify, organize and share information about social services in your community with your stakeholders, beneficiaries, partner organizations and more.
Stars: ✭ 20 (+66.67%)
Mutual labels:  airtable
micro-airtable-api
Quickly make an API from Airtable
Stars: ✭ 30 (+150%)
Mutual labels:  airtable
sbt-kubeyml
Sbt plugin to help deploy Scala applications to Kubernetes
Stars: ✭ 37 (+208.33%)
Mutual labels:  gitlab-ci
gitlab-chart
Kubernetes Helm chart to deploy GitLab
Stars: ✭ 59 (+391.67%)
Mutual labels:  gitlab-ci
drone-gitlab-ci
Drone plugin for trigger gitlab-ci jobs.
Stars: ✭ 18 (+50%)
Mutual labels:  gitlab-ci

PocketCasts statistics

Pocket Casts statistics

Code style: black Build Status Updates License: MIT

This project lets you fetch your Pocket Casts statistics and put them into Airtable with about 80 lines of code. 🎉

Configuration

Airtable

For the tool to work you'll need a free Airtable account. If you don't have one - make one.

  1. Go to this example base: https://airtable.com/shryxs3YOERmBeHl1

  2. Click on Copy base in the top right corner

  3. Once copied delete the records

  4. Click on your profile picture in the top right corner

  5. Select Account

  6. On the page click on Generate API key on the right side under API

    • Save the key and use it later for the AIRTABLE_API_KEY key
  7. Go to this page and select your copied base: https://airtable.com/api

  8. Select AUTHENTICATION on the left side

  9. On the right side there should be a dark area with text looking like this:

    • $ curl https://api.airtable.com/v0/appr9hgXPZbBPqV4n/PocketCasts?api_key=YOUR_API_KEY
    • Save the part between the alphanumeric string for later use (here it would be appr9hgXPZbBPqV4n)
    • The saved string will be used as AIRTABLE_BASE_ID
  10. Follow the next steps

Gitlab

For this to work you'll need a free Gitlab.com account. If you don't have one - make one.

  1. Make a new project on Gitlab.com.

  2. Import this repository as the base for your project.

  3. Setup all environment variables in the project.

    • Go to Settings > CI / CD (on the left)

    • Insert variables under Variables (click expand, also see Environment variables)

  4. Setup the Pipeline Scheduler

    • Go to CI / CD > Schedules (on the left)

    • Click the green button on the right New schedule

    • Give it a description (eg. "Get new stats every 2h")

    • Select Custom ( Cron syntax ) under Interval Pattern

    • Insert the following into the field: 0 */2 * * * (runs every 2 hours)

    • Make sure under Target Branch you selected your master branch

    • Make sure the checkbox Active is checked

    • Click the Save pipeline schedule

  5. Profit! :)

Environment variables

  • POCKETCASTS_EMAIL - the email address of your PocketCasts login
  • POCKETCASTS_PASSWORT - the password to login to PocketCasts
  • AIRTABLE_BASE_ID - the ID of the Airtable base which is used to store the data
  • AIRTABLE_API_KEY - your account API key to access Airtable
  • AIRTABLE_POCKETCASTS_TABLE - the table to store the PocketCasts information in

IMPORTANT: You cannot use special characters like .!$/\| symbols in the environment variables!

Local testing

  1. Make a copy of the .env_example file and name it .env
  2. Put in your credentials as mentioned in Environment variables
  3. Test the app via docker with: make
  4. Profit! :)

Contribution

Please make sure you run black on your code before you commit it!

Lines of code

This project uses about 80 lines of code according to cloc:

➜ cloc app.py .gitlab-ci.yml
       2 text files.
       2 unique files.
       0 files ignored.

github.com/AlDanial/cloc v 1.80  T=0.01 s (157.1 files/s, 12570.7 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Python                           1             28             43             70
YAML                             1              4              0             15
-------------------------------------------------------------------------------
SUM:                             2             32             43             85
-------------------------------------------------------------------------------

Attribution

  • Pocket Casts for being an awesome podcast player!
  • airtable-python-wrapper as an awesome library to connect to Airtable
  • furgoose/Pocket-Casts as a good reference how to query the PocketCasts "API"
  • Airtable for being just an awesome tool!
  • Gitlab and GitlabCI for being an all in one solution
  • Gitlab Scheduler for Pipelines because without it you would need a server.
  • gitmoji for better understandable commits through emojis. 🎉
  • pylama for checking the code quality.
  • pytest for being an awesome testing framework.
  • pytest-cov for generating coverage reports.
  • black as an awesome code formatter for Python.
  • Travis CI for being a nice tool for CIs on Github. 👷
  • codecov for showing the code coverage and help improve it.
  • pyup for helping to keep this project secure.
  • codacy for helping improving the code quality.

[ ~ Dependencies scanned by PyUp.io ~ ]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].