DEV Community

Ichi
Ichi

Posted on

3

"Twitter for xxx" disappeared, so I created Check Tool

Hi dev.
Recently, Twitter's tweet page no longer shows the origin of tweets such as "Twitter for Android," "Twitter for iOS," and "Twitter Web App," which previously existed.

Image description

But if you use Twitter API, you can get it. So I created a mini-tool to make that available to everyone.

▼You can try it now :D
https://tools.ic731.net/twitter/for/en

Image description

(note) It seems that some environments can see it and some can't.

About API

In this case, I used Twitter API v2 with PHP, which extract tweet ID from URL and throw a GET request to /2/tweets.

For API operations, I used well-known library abraham/twitteroauth.
So, please note that setApiVersion("2") is required to use v2.

$connection = new TwitterOAuth($ck, $cs, null, $brarer);
$connection->setApiVersion("2");
$id = '123456789';
$params = [
  "ids" => $id,
  "tweet.fields" => "source"
];
// GET
$tweets = $connection->get("tweets", $params);
Enter fullscreen mode Exit fullscreen mode

And "Twitter for xxx", which is the key this time, is stored in $tweets->data[0]->source. That's all for this simple application. Please try it!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (1)

Collapse
 
mb_hasan_7a57f34b923da1b3 profile image
Mb Hasan

123456789

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay