james-atkinson / speedcomplainer

A python app that will test your internet connection and then complain to your service provider (and log to a data store if you'd like)
509 stars 105 forks source link

Error: No JSON object could be decoded #20

Open BenSwansea opened 8 years ago

BenSwansea commented 8 years ago

I get the above error message when trying to run the file. This is my config.json file but i removed the twitter keys

Made a stupid mistake? Also how would I tweet @plusnethelp as well as @plusnet ?

"{ "twitter": { "twitterToken": "", "twitterConsumerKey": "", "twitterTokenSecret": "", "twitterConsumerSecret": "" }, "tweetTo": "@Plusnet", "internetSpeed": "40", "tweetThresholds": { "10": [ "Hey {tweetTo} I'm paying for {internetSpeed}Mb/s but getting only {downloadResult} Mb/s?!? Sort it Out.", ], "20": [ "Hey {tweetTo} why am I only getting {downloadResult}Mb/s when I pay for {internetSpeed}Mb/s? Not Great!" ], "36": [ "Well {tweetTo} Well {downloadResult}Mb/s is a start, but I should have {internetSpeed}Mb/s" ] }, "log": { "type": "csv", "files": { "ping": "pingresults.csv", "speed": "speedrestuls.csv" } } } "

cosmickatamari commented 7 years ago

I know this is old but not sure if you've fixed it. Use an online JSON validation here: http://jsonlint.com/

This is what my code ended up looking like:

{ "twitter": { "twitterToken": "1583282600-", "twitterConsumerKey": "", "twitterTokenSecret": "", "twitterConsumerSecret": "" },

"tweetTo": "@coxcomm",
"internetSpeed": "50",

"tweetThresholds": {
    "5": ["So {tweetTo} ... for $56/month I expect better than {downloadResult}Mbit/s when I'm paying for {internetSpeed}Mbit/$. I hope I'm getting a HUGE discount?"],
    "25": ["Hey {tweetTo} why am I only getting {downloadResult}Mb/s when I pay for {internetSpeed}Mb/s? $56+/month for this$. I'll only pay half this month. :)"],
    "40": ["Well {tweetTo} I guess {downloadResult}Mb/s is better than nothing, still not worth $56/month when I expect {internetSpeed}Mb/s."]
},

"log": {
    "type": "csv",
    "files": {
        "ping": "../log/pingresults.csv",
        "speed": "../log/speedresults.csv"
    }
}

}