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

Rainfall Map #2

Open
FeXd opened this issue Aug 9, 2021 · 3 comments
Open

Rainfall Map #2

FeXd opened this issue Aug 9, 2021 · 3 comments

Comments

@FeXd
Copy link
Owner

FeXd commented Aug 9, 2021

After a recent comment on twitter, I started looking into if there was an official rain / precipitation report form the Government of Saskatchewan. The Ministry of Agriculture has two reports: https://www.saskatchewan.ca/business/agriculture-natural-resources-and-industry/agribusiness-farmers-and-ranchers/programs-and-services/information-services-for-agribusiness-farmers-and-ranchers/maps-for-farmers-and-agribusiness

The PDFs live in publications.saskatchewan.ca and are available via their API: https://publications.saskatchewan.ca/api/v1/products/113952/formats/128248/download

Look into how easy it would be to figure out the URL and regularly download.

@FeXd
Copy link
Owner Author

FeXd commented Aug 9, 2021

This is handy: https://publications.saskatchewan.ca/api/v1/products

This takes a very long time to return, but sends back a huge JSON dump of all pdocuts available. Specifying an ID will return just that data: https://publications.saskatchewan.ca/api/v1/products/113951

{
  "productId": 113951,
  "name": "Weekly Rainfall - August 2, 2021",
  "nameFrench": null,
  "shortDescriptionEnglish": "<p>Weekly Rainfall Map - August 2, 2021</p>",
  "shortDescriptionFrench": null,
  "longDescriptionEnglish": null,
  "longDescriptionFrench": null,
  "agencyId": 46,
  "agency": {
    "agencyId": 46,
    "name": "Agriculture",
    "description": "",
    "agencyTypeId": 1,
    "agencyType": {
      "agencyTypeId": 1,
      "description": "Government or External Agency",
      "active": true
    },
    "minimumOrderPrice": 0.00,
    "active": true,
    "primaryAddress": {
      "agencyAddressId": 45,
      "agencyId": 46,
      "agencyName": "Agriculture",
      "addressLine1": "3085 Albert Street",
      "addressLine2": "",
      "city": "Regina",
      "provinceCode": "SK",
      "postalCode": "S4S0B1",
      "countryCode": "CA",
      "phoneNumber": "-",
      "name": "Agriculture",
      "isPrimary": true,
      "gtdsUnitCode": "AG",
      "url": "http://www.saskatchewan.ca/agriculture",
      "email": null
    },
    "productCount": 3603,
    "userCount": 8
  },
  "agencyBranchId": 46,
  "agencyBranch": {
    "agencyId": 46,
    "name": "Agriculture",
    "description": "",
    "agencyTypeId": 1,
    "agencyType": {
      "agencyTypeId": 1,
      "description": "Government or External Agency",
      "active": true
    },
    "minimumOrderPrice": 0.00,
    "active": true,
    "primaryAddress": {
      "agencyAddressId": 45,
      "agencyId": 46,
      "agencyName": "Agriculture",
      "addressLine1": "3085 Albert Street",
      "addressLine2": "",
      "city": "Regina",
      "provinceCode": "SK",
      "postalCode": "S4S0B1",
      "countryCode": "CA",
      "phoneNumber": "-",
      "name": "Agriculture",
      "isPrimary": true,
      "gtdsUnitCode": "AG",
      "url": "http://www.saskatchewan.ca/agriculture",
      "email": null
    },
    "productCount": 3603,
    "userCount": 8
  },
  "productSubTypeId": 53,
  "productSubType": {
    "productSubTypeId": 53,
    "productTypeId": 1,
    "productType": {
      "productTypeId": 1,
      "description": "Document"
    },
    "description": "Document",
    "active": true
  },
  "productStatusType": "ACTIVE",
  "productFormatSortType": "DESCRIPTION",
  "productPublicationDate": "2021-08-04",
  "activeTimestamp": "2021-08-05T16:00:00Z",
  "inactiveTimestamp": null,
  "author": null,
  "customIdentifier": null,
  "contactAddressId": 45,
  "contactAddress": {
    "agencyAddressId": 45,
    "agencyId": 46,
    "agencyName": "Agriculture",
    "addressLine1": "3085 Albert Street",
    "addressLine2": "",
    "city": "Regina",
    "provinceCode": "SK",
    "postalCode": "S4S0B1",
    "countryCode": "CA",
    "phoneNumber": "-",
    "name": "Agriculture",
    "isPrimary": true,
    "gtdsUnitCode": "AG",
    "url": "http://www.saskatchewan.ca/agriculture",
    "email": null
  },
  "productNtsMaps": [
    
  ],
  "productFormats": [
    {
      "productFormatId": 128247,
      "productId": 113951,
      "productFormatMediumType": "DIGITAL",
      "productFormatType": "PDF",
      "taxExemptionType": "NONE",
      "isPrimary": true,
      "productVersion": null,
      "language": "English",
      "description": null,
      "price": 0.00,
      "formatPublicationDate": null,
      "activeTimestamp": "2021-08-04T19:24:57Z",
      "inactiveTimestamp": null,
      "pageCount": null,
      "digitalAttributes": {
        "productFormatDigitalId": 59043,
        "productFormatId": 128247,
        "fileName": "crprpt20210804a.pdf",
        "contentType": "application/pdf",
        "fileSize": 351611
      }
    }
  ],
  "topics": null,
  "productFormatCount": 1,
  "productRelationCount": 0,
  "productInfoCount": 0,
  "productTopicCount": 1,
  "productCategoriesCount": 1,
  "popularity": 0.0
}

@FeXd
Copy link
Owner Author

FeXd commented Aug 9, 2021

Attempted to hit: https://publications.saskatchewan.ca/api/v1/products/?agencyID=46

Received: image

c/o https://api.vivvo.com/

CitizenOne is a digital interaction broker designed to create a user-friendly and secure experience between a citizen and government. It allows government to broker access to sensitive services while protecting the citizen’s privacy and the security of their information.

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

No branches or pull requests

1 participant