Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to new team-sharing based access to anchor #91

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions anchor/Dockerfile

This file was deleted.

10 changes: 1 addition & 9 deletions anchor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,7 @@ test:

.PHONY: install
install:
pip3 install -r requirements.txt

.PHONY: docker-build
docker-build:
docker build -t openpodcast/anchor-connector .

.PHONY: docker-run
docker-run:
docker run --init -it --env-file .env -e 'CRON_SCHEDULE=* * * * *' openpodcast/anchor-connector
pipenv run pip3 install -r requirements.txt

.env.sample:
@envsync -e OPENPODCAST_API_ENDPOINT=https://api.openpodcast.dev \
Expand Down
20 changes: 20 additions & 0 deletions anchor/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
anchorconnector = "==0.6.1"
certifi = "==2022.12.7"
charset-normalizer = "==3.1.0"
idna = "==3.4"
loguru = "==0.7.0"
pyyaml = "==6.0"
requests = "==2.29.0"
tenacity = "==8.2.2"
urllib3 = "==1.26.15"

[dev-packages]

[requires]
python_version = "3.12"
12 changes: 0 additions & 12 deletions anchor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,3 @@ Copy the file to `.env` and set the variables accordingly.

One peculiarity of the API is that the podcast ID is
called `webstation_id`.

## Docker Image

We provide a Docker image for the connector. You can use it to run the connector locally.

By default, the connector will fetch data from Anchor once a day.
You can set your own schedule for executing the connector like so:

```bash
docker build -t openpodcast/anchor-connector .
docker run --init -it --env-file .env -e 'CRON_SCHEDULE=00 10 * * *' openpodcast/anchor-connector
```
15 changes: 0 additions & 15 deletions anchor/entrypoint.sh

This file was deleted.

13 changes: 7 additions & 6 deletions anchor/job/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,6 @@ def episode_all_time_video_data(connector, web_episode_id):


endpoints = [
FetchParams(
openpodcast_endpoint="podcastEpisode",
anchor_call=lambda: anchor.podcast_episode(),
start_date=date_range.start,
end_date=date_range.end,
),
FetchParams(
openpodcast_endpoint="plays",
anchor_call=get_request_lambda(
Expand Down Expand Up @@ -275,6 +269,13 @@ def episode_all_time_video_data(connector, web_episode_id):
end_date=date_range.end,
meta=meta,
),
FetchParams(
openpodcast_endpoint="podcastEpisode",
anchor_call = (lambda: [get_request_lambda(anchor.episode_metadata, web_episode_id)])(),
start_date=date_range.start,
end_date=date_range.end,
meta=meta,
),

# TODO: This endpoint is not supported by the Open Podcast API yet
# FetchParams(
Expand Down
2 changes: 1 addition & 1 deletion anchor/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
anchorconnector==0.4.0
anchorconnector==0.6.1
certifi==2022.12.7
charset-normalizer==3.1.0
idna==3.4
Expand Down
Loading