forked from Wiznet/WIZ_Ethernet_Library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Twitter.h
46 lines (39 loc) · 1.07 KB
/
Twitter.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
40
41
42
43
44
45
46
/*
Twitter.cpp - Arduino library to Post messages to Twitter using OAuth.
Copyright (c) NeoCat 2010-2011. 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
// ver1.3 - Support IDE 1.0
#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 <Ethernet.h>
#if defined(ARDUINO) && ARDUINO < 100 // earlier than Arduino 1.0
#include <EthernetDNS.h>
#endif
class Twitter
{
private:
uint8_t parseStatus;
int statusCode;
const char *token;
#if defined(ARDUINO) && ARDUINO < 100
Client client;
#else
EthernetClient client;
#endif
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