MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    GasBuddy

    Scheduled Pinned Locked Moved Requests
    16 Posts 6 Posters 11.2k Views 8 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      dherl0623
      last edited by

      Does anyone have any idea on how to implement prices from Gas Buddy. I was thinking that maybe it could be done using MMM-Iframe, but with a bit of Googling I can’t seem to find any sort of Iframe by them. I also checked out this: https://github.com/fewieden/MMM-Fuel But as far as I understand this works for Germany and Austria?

      I do a lot of driving because of work, and I thought such a module could be really neat!

      Mykle1M 1 Reply Last reply Reply Quote 0
      • Mykle1M Offline
        Mykle1 Project Sponsor Module Developer @dherl0623
        last edited by

        @dherl0623 said in GasBuddy:

        prices from Gas Buddy.

        Have you looked to see if they offer an API to their data?

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 0
        • D Offline
          doubleT Module Developer
          last edited by doubleT

          I have a similar module where I get the prices from a German gas station. With some small changes it should be possible to show prices from other sources as well. But it’s not looking for different prices in a region, only at one gas station, displaying their current price. If you have one station you’re always going to, check if the brand/station has a website with live prices. Even if you have one favorite station on Gas Buddy, it might work with some changes. But as I saw, that’s a system where other users have to put in the prices (or the station itself), so not very accurate compared to live data.

          D 1 Reply Last reply Reply Quote 0
          • D Offline
            dherl0623 @doubleT
            last edited by

            @doubleT I would be very interested in this! I do frequent usually three different gas stations.

            1 Reply Last reply Reply Quote 0
            • D Offline
              doubleT Module Developer
              last edited by doubleT

              I did some digging but wasn’t able to find a usable alternative.


              Company Website (& API)
              I don’t know if the website is down or geo-blocked for me, I can’t reach www.speedway.com
              If I could, I’d check if they have pages for each station with live prices available and if they have an API.


              Google Knowledge Graph
              I searched that station on Google and found the result page had a right hand sidebar (Google Knowledge Graph) with live prices. So I thought I could get it via the Knowledge Graph API (if you have a Google Dev API key (and activated KG), you can try it with this link) but the itemList is empty, or maybe I did something wrong. Wrong queries?


              Google Maps – or Places?
              Then I found out that when you search that station on Google Maps, it’ll also show the live prices in the sidebar on the left. But the latest info I found (some months old) say that there’s no way to access these as they’re not in the Google Maps API (or was it Places?).


              Getting the live price from the actual gas station itself, or at least from Google, would be the best solution, as the GasBuddy price is not really live, it’s only updated when a user shares the newest price.

              1 Reply Last reply Reply Quote 1
              • D Offline
                doubleT Module Developer
                last edited by doubleT

                @dherl0623

                Here are some mockups how such a module might look:

                • All/selected prices from one station:
                  alt text
                  (Note: The boxes have classes that identify the fuel and can be highlighted, if wanted.)

                • Prices from several stations:
                  alt text

                The reason behind this differentiation: Instead of four calls, like in the second mode, there’s only one call in the first mode. Why is this important? Load time, traffic, …

                At the bottom of each box we see the last time the price was updated. I’m not quite satisfied with the mockup, yet.

                One thing I’m trying to work out in the design at the moment is adding some sort of “advice” that lets you know if the price is good. What I had in mind was an arrow element that would show if the current price is higher or lower (or same) than the last one.
                And similar to that how about adding the highest and the lowest price of the last 7 days so you can make a decission based on that? That’d mean a redesign of the whole thing.

                Is there anything you’d like to see in a module like that, that I didn’t mention? Would you like the address/place of the station somewhere? Let me know what you think.

                D 1 Reply Last reply Reply Quote 3
                • Mykle1M Offline
                  Mykle1 Project Sponsor Module Developer
                  last edited by Mykle1

                  @doubleT said in GasBuddy:

                  Let me know what you think.

                  I think . . . that is one good looking module. Now you’re MY GasBuddy. :-) Well done!

                  Edit: Is there a link to the repo? :-)

                  Create a working config
                  How to add modules

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    dherl0623 @doubleT
                    last edited by

                    @doubleT I think this looks great! I really like how simple and sleek it looks. Really all I was looking for was a simple gas price display. The price history functionality sounds interesting, and I’m not sure what more could be added beyond that.

                    1 Reply Last reply Reply Quote 0
                    • G Offline
                      Genie
                      last edited by

                      Hi

                      i know this topic is old but im curious if someone had manages to succesfully to add module to Magic Mirror to see gas prices like from Gasbuddy.com or from Speedway.com

                      /
                      Genie

                      Mykle1M 1 Reply Last reply Reply Quote 0
                      • Mykle1M Offline
                        Mykle1 Project Sponsor Module Developer @Genie
                        last edited by Mykle1

                        @Genie

                        I wrote a request to Speedway to see if they have an API that I could make use of. I didn’t write to Gasbuddy as their site didn’t make it easy to contact them.

                        In the meantime, I’ll look about for a free API that has accurate results

                        Create a working config
                        How to add modules

                        1 Reply Last reply Reply Quote 1
                        • D Offline
                          dherl0623
                          last edited by

                          @doubleT Did send me his Repo for the GasBuddy module. He didn’t want it published as he did not get permission to pull from their API. I can not get it to work unfortunately. I sent a message to doubleT, but he hasn’t been active in a while. @Mykle1 Maybe I can send you the repo and take a look at it? I can’t seem to figure out what I’m doing wrong!

                          1 Reply Last reply Reply Quote 1
                          • D Offline
                            dherl0623
                            last edited by dherl0623

                            @Mykle1 Maybe you can help me decipher this error:

                            /home/pi/.pm2/logs/mm-error-0.log last 10 lines:
                            0|mm       | SyntaxError: Unexpected end of JSON input
                            0|mm       |     at /home/pi/MagicMirror/modules/GasStation/node_helper.js:44:22
                            0|mm       |     at ChildProcess.exithandler (child_process.js:225:5)
                            0|mm       |     at emitTwo (events.js:106:13)
                            0|mm       |     at ChildProcess.emit (events.js:191:7)
                            0|mm       |     at maybeClose (internal/child_process.js:877:16)
                            0|mm       |     at Socket. (internal/child_process.js:334:11)
                            0|mm       |     at emitOne (events.js:96:13)
                            0|mm       |     at Socket.emit (events.js:188:7)
                            0|mm       |     at Pipe._handle.close [as _onclose] (net.js:493:12)
                            
                            [STREAMING] Now streaming realtime logs for [mm] process
                            

                            Should I be looking at line 44 char 22 for something ?

                            Mykle1M strawberry 3.141S 2 Replies Last reply Reply Quote 1
                            • Mykle1M Offline
                              Mykle1 Project Sponsor Module Developer @dherl0623
                              last edited by

                              @dherl0623 said in GasBuddy:

                              Unexpected end of JSON input

                              The problem seems to be with line 44 of the node_helper, not necessarily character 22 itself. I think you should concentrate on the explanation of the error.

                              Create a working config
                              How to add modules

                              1 Reply Last reply Reply Quote 1
                              • strawberry 3.141S Offline
                                strawberry 3.141 Project Sponsor Module Developer @dherl0623
                                last edited by

                                @dherl0623 you should log the response of gasbuddy, sounds like you are not getting a valid json response from the api

                                Please create a github issue if you need help, so I can keep track

                                1 Reply Last reply Reply Quote 1
                                • D Offline
                                  dherl0623
                                  last edited by

                                  @strawberry-3-141 Going to the site https://www.gasbuddy.com/assets-v2/api/stations/26220/fuels which is the response that GasBuddy gives outputs the following
                                  {"station_id":26220,"fuels":[{"id":1,"fuelType":"Regular","stationId":26220,"prices":[{"isCash":false,"price":3.01,"reportedBy":"kayChanh","postedTime":"2018-05-17T08:21:56.359Z"}]},{"id":2,"fuelType":"Midgrade","stationId":26220,"prices":[{"isCash":false,"price":3.31,"reportedBy":"Fklem","postedTime":"2018-05-17T01:34:26.786Z"}]},{"id":3,"fuelType":"Premium","stationId":26220,"prices":[{"isCash":false,"price":3.61,"reportedBy":"Fklem","postedTime":"2018-05-17T01:34:26.797Z"}]},{"id":4,"fuelType":"Diesel","stationId":26220,"prices":[{"isCash":false,"price":3.35,"reportedBy":"crazykyser116","postedTime":"2018-05-17T07:35:33.984Z"}]}]}

                                  Can I share the download link to the module? I haven’t gotten a response back from @doubleT and as far as I know no one has gotten permission from GasBuddy to use their API in this way.

                                  1 Reply Last reply Reply Quote 1
                                  • yawnsY Offline
                                    yawns Moderator
                                    last edited by

                                    If you want to, send it to me. I can take a look today or tomorrow.

                                    1 Reply Last reply Reply Quote 1

                                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                    With your input, this post could be even better 💗

                                    Register Login
                                    • 1 / 1
                                    • First post
                                      Last post
                                    Enjoying MagicMirror? Please consider a donation!
                                    MagicMirror created by Michael Teeuw.
                                    Forum managed by Sam, technical setup by Karsten.
                                    This forum is using NodeBB as its core | Contributors
                                    Contact | Privacy Policy