Display Forum status on LCD

So i just wanted to put together a quick 'have fun project' which will display the forum status on an LCD itself.

@dave i need some inputs from you.

I ran this code:

   char server[] = "community.spark.io";

    void setup() {
      if (client.connect(server, 80)) {
        Serial.println("connected");
    // Make a HTTP request:
    client.println("GET /srv/status/ HTTP/1.0");
    client.println("Host: community.spark.io" );
    client.println("Connection: close");
    client.println();
  } 

HTTP/1.1 301 Moved Permanently
Server: nginx/1.4.3
Date: Thu, 06 Mar 2014 01:18:18 GMT
Content-Type: text/html
Content-Length: 184
Connection: close
Location: https://community.spark.io/srv/status/

And the serial output:

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.4.3</center>
</body>
</html>

Which command did i sent wrong?

This looks like an http vs https problem. You are getting a redirect to https.

Totally, the community site wants to be https, so it’s trying to get you to go there instead. Hmm… I’ve been working on a way to make this kind of https request possible from the core though, so maybe we can get that going after this sprint.

is there a way to call to https? I’m not really familiar with this :smiley:

Ah thanks @Dave. This project has to sort of be on hold then!

It’s kinda fun to have like a visual notification. Eg. WS2812 RGB leds for the various Services.

Like you get a Visual of the :spark: infrastructure should things don’t work and you aren’t monitoring :smiley:

kennethlimpc, as far as I know, https/ssl support is beyond the Spark. However, I noticed that status.spark.io does not include the community status. It may be worth adding it.

1 Like

This is cool, but what do you guys mean by “community status”? If you mean how many unread/new posts there are… you’ll also have to manage logging in as well if you want your own stats. Not the hardest thing to do… unless I have the “status” wrong.

It’s just simple real simple @BDub. Haha!

Whether the forum is down or running. :slight_smile:

Probably an overkill for a core to do this but…why not!

People can try their hands on making something. ^^

Yeah those can be polled as well and you’re right about the authentication and all.

Sadly as of now, discourse API isn’t really proper and some things like ‘no_of_latest_post(period)’ or ‘new_notifications’ arent available.

I wanted to make it that way like to be notified when I have a new notification by the core but for now the only useful API I think to make something is the forum status… hmm…

Ohhh, that is less complicated than I was thinking. Well let me tell you from experience I will say the forum has a 99.9+% uptime, but agreed it’s a way for users to learn from an example. Once you get the https loading, you can scrape the page for more fun stuff.