我不喜歡回答我自己的問題,但我已經修復它,以防萬一任何人有同樣的問題,我會在這裏記錄它。
我修改了twitCurl代碼以添加一個額外的參數,一個字符串來表示'since_id'。這真的很簡單,我已經將修改提交給了twitCurl開發人員。這裏是我的變化,如果你不能等待:
Index: twitcurl.cpp
===================================================================
--- twitcurl.cpp (revision 25)
+++ twitcurl.cpp (working copy)
@@ -474,19 +474,28 @@
*
* @description: method to get mentions
*
-* @input: none
+* @input: sinceId - since_id in string format
*
* @output: true if GET is success, otherwise false. This does not
check http
* response by twitter. Use getLastWebResponse() for that.
*
*--*/
-bool twitCurl::mentionsGet()
+bool twitCurl::mentionsGet(std::string sinceId)
{
bool retVal = false;
if(isCurlInit())
{
+ /* Prepare URL */
+ std::string buildUrl("");
+ buildUrl = twitterDefaults::TWITCURL_MENTIONS_URL;
+ if(sinceId.length())
+ {
+
buildUrl.append(twitCurlDefaults::TWITCURL_SINCEID.c_str());
+ buildUrl.append(sinceId.c_str());
+ }
+
/* Perform GET */
- retVal =
performGet(twitterDefaults::TWITCURL_MENTIONS_URL);
+ retVal = performGet(buildUrl);
}
return retVal;
}
Index: twitcurl.h
===================================================================
--- twitcurl.h (revision 25)
+++ twitcurl.h (working copy)
@@ -24,6 +24,7 @@
const std::string TWITCURL_EXTENSIONFORMAT = ".xml";
const std::string TWITCURL_TARGETSCREENNAME = "?
target_screen_name=";
const std::string TWITCURL_TARGETUSERID = "?target_id=";
+ const std::string TWITCURL_SINCEID = "?since_id=";
};
/* Default twitter URLs */
@@ -123,7 +124,7 @@
bool timelineFriendsGet();
bool timelineUserGet(std::string userInfo = "" /* in */, bool
isUserId = false /* in */);
bool featuredUsersGet();
- bool mentionsGet();
+ bool mentionsGet(std::string sinceId = "");
/* Twitter user APIs */
bool userGet(std::string& userInfo /* in */, bool isUserId =
false /* in */);