{"id":17834671,"url":"https://github.com/bendog/fuelwatch","last_synced_at":"2025-10-18T15:22:48.164Z","repository":{"id":96330684,"uuid":"188881960","full_name":"bendog/fuelwatch","owner":"bendog","description":"Proof of concept of FuelWatch scrape and list api","archived":false,"fork":false,"pushed_at":"2019-06-27T10:01:40.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T12:49:27.936Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bendog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2019-05-27T17:10:07.000Z","updated_at":"2019-06-27T10:01:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"44688b79-7020-40c3-b1b1-4f855e7a2c92","html_url":"https://github.com/bendog/fuelwatch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bendog/fuelwatch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendog%2Ffuelwatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendog%2Ffuelwatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendog%2Ffuelwatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendog%2Ffuelwatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bendog","download_url":"https://codeload.github.com/bendog/fuelwatch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendog%2Ffuelwatch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259990976,"owners_count":22942552,"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":[],"created_at":"2024-10-27T20:09:29.495Z","updated_at":"2025-10-18T15:22:43.145Z","avatar_url":"https://github.com/bendog.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fuel Watch Rest/GraphQL api example\n\nProof of concept for a dynamic backend for Fuel Watch scraping.\n\n## Django + Graphene + Django-Rest-Framework app\n\ntodo:\n\n- Django Rest filter for date valid today\n- Django GraphQL filter for date valid today\n\n### setup a new database\n\n    cd fuelapp\n    ./manage.py migrate\n    ./manage.py runserver\n\nthen browse to \u003chttp://127.0.0.1:8000/update\u003e to populate the database\n\n### run an existing app\n\n    cd fuelapp\n    ./manage.py runserver\n\nthen browse to \u003chttp://127.0.0.1:8000/graphql\u003e for graphql interface\nor browse to  \u003chttp://127.0.0.1:8000/rest/\u003e for django rest framework interface\n\n### Django Rest Framework example queries\n\n- price list for a collection of suburbs \u003chttp://localhost:8000/rest/price/?location__suburb__in=SOUTH+PERTH%2CCOMO%2CMANNING%2CKENSINGTON\u0026ordering=price\u003e\n- price list for a brand \u003chttp://localhost:8000/rest/price/?location__brand__istartswith=BP\u0026ordering=price\u003e\n- price list for a date \u003chttp://localhost:8000/rest/price/?date__gte=2019-05-28\u0026ordering=price\u003e\n- location list ordered by suburb with prices \u003e= a date \u003chttp://localhost:8000/rest/location/?prices__date__gte=2019-05-28\u0026ordering=suburb\u003e\n\n### Django Graphene graphql example queries\n\nSearch for all fuel in a suburb\n\n```graphql\n{\n  allLocations(suburb: \"PERTH\") {\n    edges {\n      node {\n        id\n        brand\n        address\n        prices {\n          edges {\n            node {\n              price\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nSearch for all Caltex, Shell and BP, sorting by Price and return first 50\n\n```graphql\n{\n  allLocations(orderBy:\"prices__price\", first:50, brand_In:\"Caltex,Shell,BP\") {\n    edges {\n      node {\n        id\n        brand\n        address\n        prices {\n          edges {\n            node {\n              price\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nSeach for all Caltex, Shell and BP, where prices after a date are less than $1.35, ordering by price and returning the first 50\n\n```graphql\n{\n  allLocations(\n    orderBy: \"prices__price\",\n    first: 50,\n    brand_In: \"Caltex,Shell,BP\",\n    prices_Price_Lte: 135,\n    prices_Date_Gte: \"2019-05-28\",\n  ) {\n    edges {\n      node {\n        id\n        tradingName\n        address\n        suburb\n        prices {\n          edges {\n            node{\n              price\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n## Flask app\n\ntodo:\n\n- pretty much everything\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendog%2Ffuelwatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbendog%2Ffuelwatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendog%2Ffuelwatch/lists"}