rubycurldashing

Update Table via cURL in Dashing dashboard


For the last few weeks I have been working on sending data to my ruby based Smashing dashboard. I have been able to update widgets with cURL on the dashboard except for the Table I installed. It can update itself via the Ruby code that comes with it, but the cURL example that is on the Project's page does not work.

Here are some things I have tried:

  1. Using cURL on Linux and Windows
  2. Using Fiddler to monitor the JSON that the server is sending the browser and sending that JSON with cURL
  3. Trying all sorts of formatting
  4. Converting the default content of the Ruby script to a cURL command and sending it
  5. And more...

So anyways, I'm running out of things to try. I feel like this should be a very easy task and I'm sure that many people have managed.

Here is the curl command that is displayed as an example on the Project's page:

  curl -d '  { "auth_token":"YOUR_AUTH_TOKEN",
            "hrows": [ {"cols": [ {"value":"Name 0"}, {"value":"Value 0"} ] } ],
            "rows":  [ {"cols": [ {"value":"Name 1"}, {"value":"Value 1"} ] },
                       {"cols": [ {"value":"Name 2"}, {"value":"Value 2"} ] },
                       {"cols": [ {"value":"Name 3"}, {"value":"Value 3"} ] },
                       {"cols": [ {"value":"Name 4"}, {"value":"Value 4"} ] } ]
          }' http://localhost:3030/widgets/table

When I send that command, I can see in Fiddler that the server sends the dashboard new data, the problem is that the the widget is never updated.

Does anyone have any idea what I can try next?

Thanks,

Roger


Solution

  • Figured it out:

    Turns out it is pretty simple:

    Problem: The cURL target ("table") example on the project page does not correspond to the ID of the table widget HTML ("my-table") (as of November 8, 2017)

    Solution: Make sure the cURL request you are sending on that page matches the ID of the HTML element

    Hope this helps some one!

    Cheers,

    Roger