Private APIs of the Twitter ad Platform

Source: Internet
Author: User
Promoted Tweets is an advertisement platform for Twitter. The author of this article finds that some advertisements are not displayed in official Twitter applications, and decides to analyze whether Twitter has done anything. There are no detailed steps, but you can understand the use of some tools and a small Twitter action.

Twitter on Mac has some strange behavior: some content on timeline has been filtered out. compared with the web version, the content of "howaboutwe.com" is not displayed in the application.

Is this a bug, or does Twitter break the rules? Why does the official application and Web Client obtain different data? Does Twitter use APIs that are not publicly available? To find out the answer, I operated a surgical knife on Twitter.

Reverse Engineering Twitter. app

Twitter sleuthing 101

  1. Use class-dump to disassemble and extract declaration information.
  2. Use Hopper. app to find the code used to process HTTP requests.
  3. Use GDB to detect the network response to the API.
  4. Use rested for Mac to compare the APIs used to obtain data twice.

Fortunately, this application is written purely in Objective C. You can use Class-dump to understand the basic content of Twitter. app and how to design it. First, it is found that one of the twitterstatus may be related to the previous filtering behavior. Note whether a promoted flag is used (the importance of naming ):

@ Interface twitterstatus: nsobject <...>
{
Nsdate * lastupdated;
...
Struct {
...
Unsigned int ispromoted: 1;

We can assume that Twitter receives Promoted Tweets content from the API server and uses this flag to differentiate it.

Analyze Data streams (on to the Data Stream)

After an hour or two, the hopper. app finds the code that responds to network data. The name is [abhttprequest connection: didreceiveresponse:].

When using GDB (Hopper provides a GDB server that can be used together with Hopper for debugging), set breakpoints in Twitter. app, and then you can see what data is obtained from the server.

Run GDB in terminal:

> Cd/applications/Twitter. APP/contents/MACOs/
> GDB -- arch = i386

Add Twitter and set the breakpoint:

> (GDB) Exec-file Twitter
> (GDB) B * 0x6dec3
> (GDB) commands
> X/S $ eax
> End
> (GDB) set print elements 0
> (GDB) r

First, you must know that Twitter uses XML to transmit data. The API server first responds to your user information and then sends your timeline feed content. Compared with the online version, we found that the content is indeed different.

Is this an unauthenticated ented API?
Why didn't the Twitter. app collect the data? Or what data does the API server not return?

With rested for Mac, you can quickly pull back the content in my timeline. The following result shows that the API does not return any Promoted Tweets.

Conclusion: Twitter has a private API (Conclusion: Twitter has a secret feed for Promoted Tweets)
The FAQ on the Twitter Development page shows, "From March 12,201 2, third-party applications will no longer have APIs related to Twitter promoted products (there is no advertising API for serving Twitter's promoted products in third party applications ). "That is, Promoted Tweets should appear in all applications that use APIs. Obviously, this is not the case.

For the big pie of mobile advertisements (Twitter received 2014 billion US dollars in 0.54 billion), Twitter did not offer developers a piece of cake as they advertised. Do you know where your Promoted Tweets went?

Michael schonfeld is head of developer relations at dwolla, a service that empowers anyone with an Internet connection to send money simply. follow Michael
Schonfeld and his brotherdaniel schonfeld on Twitter.

Address: http://www.fastcompany.com/3002016/reverse-engineering-twitter-solve-advertising-mystery

Reprinted please indicate the source: http://blog.csdn.net/horkychen

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.