Авторизация Twitter

Discussion in 'С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby' started by Sanek737, 23 Jun 2012.

  1. Sanek737

    Sanek737 New Member

    Joined:
    24 Dec 2011
    Messages:
    10
    Likes Received:
    1
    Reputations:
    0
    Помогите написать авторизацию на твиттер. Работаю в Delphi XE2
     
    #1 Sanek737, 23 Jun 2012
    Last edited: 23 Jun 2012
  2. shadowrun

    shadowrun Banned

    Joined:
    29 Aug 2010
    Messages:
    842
    Likes Received:
    170
    Reputations:
    84
    С удовольствием поможем. Покажи код, что не получается? :cool:
     
  3. Sanek737

    Sanek737 New Member

    Joined:
    24 Dec 2011
    Messages:
    10
    Likes Received:
    1
    Reputations:
    0
    Вот я пытался, но это совсем не то.

    http := THTTPSend.Create;
    http.Protocol := '1.1';
    http.AddPortNumberToHost := False;
    startTime := EncodeDateTime(1970, 1, 1, 0, 0, 0, 0);
    currTime := Now;
    msec1 := MilliSecondsBetween(currTime, StartTime);
    params := 'session[username_or_email]=' + edLogin.Text;
    params := params + '&session[password]=' + edPass.Text;

    params := params + '&redirect_after_login=';
    http.Document.Write(Pointer(params)^, Length(params));
    http.MimeType := 'application/x-www-form-urlencoded';
    url := 'https://twitter.com/sessions?phx=1';
    http.HTTPMethod('POST', url);
    HeadersToList(http.Headers);
    url := trim(http.Headers.Values['Location']);
    http.Clear;
    http.HTTPMethod('GET', url);
    str := ReadStrFromStream(http.Document, http.Document.Size);
     
  4. leeex

    leeex New Member

    Joined:
    26 Jul 2011
    Messages:
    8
    Likes Received:
    1
    Reputations:
    0
    Быть может дело в том, что HTTPS требует шифрование, а ты его в своей программе не учитываешь?
     
  5. mironich

    mironich Elder - Старейшина

    Joined:
    27 Feb 2011
    Messages:
    733
    Likes Received:
    73
    Reputations:
    19
    Что за бред....
    Оно на уровне сокетов происходит.
     
  6. Chrome~

    Chrome~ Elder - Старейшина

    Joined:
    13 Dec 2008
    Messages:
    936
    Likes Received:
    162
    Reputations:
    27
    Для работы с https в Synapse необходимо подключить модуль ssl_openssl. Проверь, подключен ли он у тебя.
     
    1 person likes this.
  7. mironich

    mironich Elder - Старейшина

    Joined:
    27 Feb 2011
    Messages:
    733
    Likes Received:
    73
    Reputations:
    19
    Да и длл-ки должны быть.
     
  8. Sanek737

    Sanek737 New Member

    Joined:
    24 Dec 2011
    Messages:
    10
    Likes Received:
    1
    Reputations:
    0
    Потёрто
     
    #8 Sanek737, 23 Jun 2012
    Last edited: 24 Jun 2012