GithubHelp home page GithubHelp logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
Interestingly, it's working without semi colon for me! And, another thing to 
note is we're using DELETE whereas twitter API page says POST.

Original comment by [email protected] on 3 Jun 2012 at 9:34

from twitcurl.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
Even if this is an old thread, i can't delete tweets still today. i tried first 
this:
bool twitCurl::statusDestroyById( std::string& statusId )
{
    if( statusId.empty() )
    {
        return false;
    }
    /* Prepare URL */
    std::string buildUrl = twitCurlDefaults::TWITCURL_PROTOCOLS[m_eProtocolType] +
                           twitterDefaults::TWITCURL_STATUDESTROY_URL
             + twitCurlDefaults::TWITCURL_COLON // added by me
             + statusId +
                       twitCurlDefaults::TWITCURL_EXTENSIONFORMATS[m_eApiFormatType];

    /* Perform DELETE */
    return performDelete( buildUrl );
}

and i get "{"errors":[{"message":"Sorry, that page does not exist","code":34}]}"
when i remove twitCurlDefaults::TWITCURL_PROTOCOLS (what seems to be similiar 
to your solution) or twitCurlDefaults::TWITCURL_COLON or both i get 
"{"errors":[{"message":"Could not authenticate you","code":32}]}". And if i 
replace performDelete by performPost what should be right according to REST API 
i get bad request errors. Any ideas?
PS: Maybe i haven't got enough oAuth knowledge, do i have to authorize my app 
in some kind for every delete operation or is this done automatically by 
twitcurl? (So if you ask: Yes i did authorize my app at twitter and in my 
account, because i can successfully post tweets and get my user_timeline, but 
just cannot delete tweets)

Original comment by [email protected] on 14 Oct 2014 at 1:46

from twitcurl.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 24, 2024
if anyone is still interested in this, i solved my problem after trial and 
error with this method:

bool twitCurl::statusDestroyById( std::string& statusId )
{
    if( statusId.empty() )
    {
        return false;
    }

    std::string msgToPost = "id=" + statusId;

    /* Prepare URL */
    std::string buildUrl = twitCurlDefaults::TWITCURL_PROTOCOLS[m_eProtocolType] +
                           twitterDefaults::TWITCURL_STATUDESTROY_URL
            //+ twitCurlDefaults::TWITCURL_COLON    // not added by me
            + statusId +
                        twitCurlDefaults::TWITCURL_EXTENSIONFORMATS[m_eApiFormatType];

    /* Perform POST */
    return performPost( buildUrl, msgToPost );
}

I think this results in a request like this:
POST https://api.twitter.com/1.1/statuses/destroy/12345678.json?id=12345678
what seems to be redundant and not like in the documentation (which says to use 
a colon first but has none in the example 
https://dev.twitter.com/rest/reference/post/statuses/destroy/%3Aid )

Original comment by [email protected] on 20 Oct 2014 at 1:07

from twitcurl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.