Thread: Login Program

  1. #1
    Registered User
    Join Date
    Nov 2004

    Post eBay Login Program

    well what I am trying to achieve, is to develope a program that can
    log into my eBay account.

    I was sure that they would use some weird ways to pass the login names and so on, but I didn't think it would be this hard to realize or to figure out.
    Well what I have done so far is to connect to ebay send them a POST with the login data and some more stuff they require and then download the html source of the page I get redirected to. But I don't get further than the part before the redirection.

    I have used this code on different pages and it works there but I just can't figure this out.

    I'm using cUrl for internet code (e.g. downloading source to memory, send POSTs, etc.)

    #include <stdio.h>
    #include <curl.h>
    int main(void)
      CURL *curl;
      CURL *curl2;
      CURLcode res;
      FILE *file = fopen("test.txt", "w");
      struct MemoryStruct chunk;
      chunk.memory=NULL; /* we expect realloc(NULL, size) to work */
      chunk.size = 0;    /* no data at this point */
      curl = curl_easy_init();
      curl2 = curl_easy_init();
      /* First set the URL that is about to receive our POST. This URL can
         just as well be a https:// URL if that is what should receive the
         data. */
      curl_easy_setopt(curl, CURLOPT_URL, "");
      /* Now specify additional HTTP Header data */
      //curl_easy_setopt(curl, CURLOPT_HTTPHEADER, 
            "Location: /eBayISAPI.dll?MyEbaySellingSoldListings"
      /* Now specify the POST data */
      curl_easy_setopt(curl, CURLOPT_POSTFIELDS, 
      /* some servers don't like requests that are made without a user-agent
         field, so we provide one */
      curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcurl-agent/1.0");
      //curl_easy_setopt(curl, CURLOPT_HTTPGET,
      /* send all data to this function  */
      curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
      /* we pass our 'chunk' struct to the callback function */
      curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk);
      /* get it! */
      /* always cleanup */
      printf("%d", sizeof(chunk.size));
      fprintf(file, "%s", chunk.memory);
      return 0;
    Have any of you tried/done anything like this?
    Any information or tips are appreciated.
    Last edited by tboy; 12-03-2004 at 09:40 AM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    Easiest thing to do is grab a copy of ethereal ( and use it to watch what your browser does.
    Then do the same thing in your curl program.

  3. #3
    Join Date
    Oct 2004
    Keep in mind that alot of sites will not allow you to send login information unless it sent from the website itself. This could well be the case with a large site such as ebay.

    Hint, make your program behave like a browser.
    Microsoft is merely an illusion, albeit a very persistant one.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Login Form for program
    By Houssen in forum C++ Programming
    Replies: 3
    Last Post: 03-29-2008, 02:35 PM
  2. simple login program problem
    By suckss in forum C Programming
    Replies: 11
    Last Post: 11-11-2006, 05:02 PM
  3. Need help with my program...
    By Noah in forum C Programming
    Replies: 2
    Last Post: 03-11-2006, 07:49 PM
  4. my server program auto shut down
    By hanhao in forum Networking/Device Communication
    Replies: 1
    Last Post: 03-13-2004, 10:49 PM
  5. redirection program help needed??
    By Unregistered in forum Linux Programming
    Replies: 0
    Last Post: 04-17-2002, 05:50 AM