-
Notifications
You must be signed in to change notification settings - Fork 1
/
TwitterWiFly.h
39 lines (32 loc) · 909 Bytes
/
TwitterWiFly.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
Twitter.cpp - Arduino library to Post messages to Twitter using OAuth.
Copyright (c) NeoCat 2010. All right reserved.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
// ver1.2 - Use <Udp.h> to support IDE 0019 or later
#ifndef TWITTER_H
#define TWITTER_H
#include <inttypes.h>
#include <avr/pgmspace.h>
#if defined(ARDUINO) && ARDUINO > 18 // Arduino 0019 or later
#include <SPI.h>
#endif
#include <WiFly.h>
//#include <EthernetDNS.h>
class Twitter
{
private:
uint8_t parseStatus;
int statusCode;
const char *token;
Client client;
public:
Twitter(const char *user_and_passwd);
bool post(const char *msg);
bool checkStatus(Print *debug = NULL);
int wait(Print *debug = NULL);
int status(void) { return statusCode; }
};
#endif //TWITTER_H