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

[ParksOnTheAir] New bridge #2086

Merged
merged 1 commit into from
Apr 1, 2022
Merged

Conversation

s0lesurviv0r
Copy link
Contributor

Parks On The Air is an amateur radio event. The POTA website offers a spotting network to see who's activating what parks and where. This bridge utilizes the spotting network's JSON api to return as an RSS feed.

@s0lesurviv0r s0lesurviv0r force-pushed the parks-on-the-air branch 3 times, most recently from e2344da to 3e2f05c Compare April 27, 2021 23:26
@dvikan
Copy link
Contributor

dvikan commented Mar 23, 2022

https://api.pota.us/spot/activator doesn't return anything useful. Api not working?

@s0lesurviv0r
Copy link
Contributor Author

The ParksOnTheAir api provides real-time spots of operators as reported by users. If there are no user reports then this API will return an empty list. I just checked this endpoint and got:

[
  {
    "spotId": 2917014,
    "activator": "K7CAR",
    "activatorLastSpotTime": "2022-03-24T05:02:15",
    "activatorLastComments": "Broadcast fired up.  Moved...will listen.",
    "frequency": "7172",
    "mode": "SSB",
    "reference": "K-0676",
    "parkName": null,
    "spotTime": "2022-03-24T05:09:09",
    "spotter": "K6YYL",
    "comments": "There now. Listening but you are a lighter copy than the other ham.",
    "source": "Web",
    "invalid": null,
    "name": "Lake Mead National Recreation Area",
    "locationDesc": "US-AZ,US-NV",
    "grid4": "DM26",
    "grid6": "DM26oa",
    "latitude": 36.0099,
    "longitude": -114.797,
    "count": 39,
    "expire": 1800
  },
  {
    "spotId": 2917013,
    "activator": "JF7RJM/7",
    "activatorLastSpotTime": null,
    "activatorLastComments": null,
    "frequency": "7005.5",
    "mode": "CW",
    "reference": "JA-0009",
    "parkName": null,
    "spotTime": "2022-03-24T05:08:45",
    "spotter": "JH7CSU1-#",
    "comments": "RBN 26 dB 20 WPM via JH7CSU1-#",
    "source": "RBN",
    "invalid": null,
    "name": "Bandai-Asahi National Park",
    "locationDesc": "JP-FS,JP-NI,JP-YT",
    "grid4": "PM97",
    "grid6": "PM97ut",
    "latitude": 37.8229,
    "longitude": 139.74,
    "count": 2,
    "expire": 1776
  }
]

@Bockiii
Copy link
Contributor

Bockiii commented Mar 25, 2022

Is the cache timeout of 1 minute actually necessary? Do you know how long the entries stay in the api?

@Bockiii
Copy link
Contributor

Bockiii commented Mar 28, 2022

I'm torn.

On the one hand, the bridge works and probably does what it's supposed to do. I can summise that from the code and the website behind it.

On the other hand, this bridge will return 0 items 99.99% of the time, which makes it a biiiitch for automated testing (no result is usually not a good sign) and also for just general use. If I'm a user, starting off with this bridge, I would not be confident that the bridge works, as... there is no feed at all.

I think it would make more sense to crawl the "activations" page and put those scheduled objects into items, but I think they are dynamic, so it will require some additional work.

I haven't landed on one or the other yet. What do others think? @yamanq @dvikan @em92 @VerifiedJoseph

@yamanq
Copy link
Contributor

yamanq commented Mar 28, 2022

https://api.pota.app/spot/activator is the endpoint used by pota.app, which is the link I get to when I click "POTA Spots" on the parksontheair.com page. While the api.pota.us endpoint returns null, this one returns many more results for me.

If this endpoint is also empty at times, one solution could be generating a static feed item when there are no results but the request status code is 200. It would have the same uid every time so that RSS clients could keep the item out of view.

Regarding the cache timeout, I think it is fine considering the POTA webapp refreshes its own data (including several more API calls than just /spot/activator) every 60 seconds too.

@s0lesurviv0r
Copy link
Contributor Author

https://api.pota.app/spot/activator provides the real-time spots. I believe the other API that you found contains the scheduled activations. They aren't taken as seriously because not everyone follows through on their planned activations. It's more beneficial to get a feed of people that are actually confirmed to be on the air.

The 60 second cache timeout was set to not overload the API. There is no need to have second-to-second updates. There is no need for someone to pounce on the a new activator. The activators stay on for quite a while, up to hours. Additionally if someone ends their activation and it still appears then the user, worst case, would lose a couple seconds tuning into that frequency and realizing no one was on the air anymore.

@Bockiii
Copy link
Contributor

Bockiii commented Mar 29, 2022

? You're using "pota.us" in the code and "pota.app" in your comment. Which is it?

@github-actions
Copy link

github-actions bot commented Mar 29, 2022

Pull request artifacts

file last change
ParksOnTheAir-pr-context1 2022-04-01, 18:03:08

@s0lesurviv0r
Copy link
Contributor Author

s0lesurviv0r commented Mar 29, 2022

My apologies, I missed this. pota.us was what I used originally. This was working when I made this PR. Parks on the air has been under active development and during this time was migrated over to the pota.app domain. I updated the PR to reflect.

@Bockiii
Copy link
Contributor

Bockiii commented Mar 29, 2022

Ah, now it makes more sense.

Please fix all of the check-errors and then I think we can merge this

@s0lesurviv0r
Copy link
Contributor Author

Sorry it took a little bit to figure out all these linting rules. I think we should be good now. Thanks for the help everyone!

@Bockiii Bockiii merged commit 40a4e7b into RSS-Bridge:master Apr 1, 2022
@s0lesurviv0r s0lesurviv0r deleted the parks-on-the-air branch April 3, 2022 00:08
Kwbmm pushed a commit to Kwbmm/rss-bridge that referenced this pull request Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants