| 1 | // |
| 2 | // Twitter.h |
| 3 | // |
| 4 | // A C++ implementation of a Twitter client based on the POCO Net library. |
| 5 | // |
| 6 | // Copyright (c) 2009-2013, Applied Informatics Software Engineering GmbH. |
| 7 | // and Contributors. |
| 8 | // |
| 9 | // SPDX-License-Identifier: BSL-1.0 |
| 10 | // |
| 11 | |
| 12 | |
| 13 | #ifndef Twitter_INCLUDED |
| 14 | #define |
| 15 | |
| 16 | |
| 17 | #include "Poco/Poco.h" |
| 18 | #include "Poco/Net/HTMLForm.h" |
| 19 | #include "Poco/Util/AbstractConfiguration.h" |
| 20 | #include "Poco/AutoPtr.h" |
| 21 | |
| 22 | |
| 23 | class |
| 24 | /// A simple implementation of a Twitter API client |
| 25 | /// (see <http://dev.twitter.com> for more information). |
| 26 | /// |
| 27 | /// Currently, only the update message is supported. |
| 28 | { |
| 29 | public: |
| 30 | (); |
| 31 | /// Creates the Twitter object, using |
| 32 | /// the default Twitter API URI (<http://api.twitter.com/1.1/statuses/>). |
| 33 | |
| 34 | (const std::string& ); |
| 35 | /// Creates the Twitter object using the given Twitter API URI. |
| 36 | |
| 37 | (); |
| 38 | /// Destroys the Twitter object. |
| 39 | |
| 40 | void (const std::string& consumerKey, const std::string& consumerSecret, const std::string& token, const std::string& tokenSecret); |
| 41 | /// Specifies the OAuth authentication information used in all API calls. |
| 42 | |
| 43 | Poco::Int64 (const std::string& status); |
| 44 | /// Updates the user's status. |
| 45 | /// |
| 46 | /// Returns the ID of the newly created status. |
| 47 | |
| 48 | Poco::AutoPtr<Poco::Util::AbstractConfiguration> (const std::string& httpMethod, const std::string& , Poco::Net::HTMLForm& params); |
| 49 | /// Invokes the given method of the Twitter API, using the parameters |
| 50 | /// given in the Poco::Net::HTMLForm object. httpMethod must be GET or POST, |
| 51 | /// according to the Twitter API documentation. |
| 52 | /// |
| 53 | /// Returns a Poco::Util::JSONConfiguration with the server's response if the |
| 54 | /// server's HTTP response status code is 200 (OK). |
| 55 | /// Otherwise, throws a Poco::ApplicationException. |
| 56 | |
| 57 | static const std::string ; |
| 58 | |
| 59 | private: |
| 60 | (const Twitter&); |
| 61 | Twitter& (const Twitter&); |
| 62 | |
| 63 | std::string ; |
| 64 | std::string ; |
| 65 | std::string ; |
| 66 | std::string ; |
| 67 | std::string ; |
| 68 | }; |
| 69 | |
| 70 | |
| 71 | #endif // Twitter_INCLUDED |
| 72 | |