"Twitch Following List Date: Your Complete Guide"
Ever found yourself wondering how to manage your Twitch following list, specifically how to see the dates you started following each channel? Twitch doesn't expose this information directly, but there's a handy workaround using the Twitch API. Let's dive into how you can fetch your following list with date information.
Before we begin, ensure you have an account with Twitch API keys. You can obtain these by registering your application on the Twitch Developer Console.
Accessing Your Following List via Twitch API
The Twitch API offers a 'Get Followed Streams' endpoint, which retrieves information about the channels you follow. To fetch your following list with dates, we'll use this endpoint along with the 'created_at' field.
Here's an example of how the JSON response looks like for the 'Get Followed Streams' endpoint:
Understanding the JSON Response
In the JSON response, the 'value' field contains an array of followed channels. Each object in this array has various properties, including the 'created_at' field, which holds the date you started following the channel.
Here's a snippet of what the 'value' field might look like:
[
{
"broadcaster_name": "channel1",
"created_at": "2022-01-15T01:02:03Z"
},
{
"broadcaster_name": "channel2",
"created_at": "2022-02-10T04:05:06Z"
}
]
How to Parse the 'created_at' Date
The 'created_at' field follows the ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ). To parse this date, you can use the local DateTime::format() function in PHP, or the DateTime format method in JavaScript.
Here's an example of how you can parse the 'created_at' date in PHP:
$created_at = new DateTime('2022-01-15T01:02:03Z');
echo $created_at->format('Y-m-d H:i:s');
Updating Your Following List Display
If your application or website displays your following list, you can now include the 'Followed Since' date to provide more context to your users. This can be especially useful for users to see when they started following a channel.
Here's an example of how you can display the 'Followed Since' date on a website:
| Channel Name | Followed Since |
|---|---|
| channel1 | Jan 15, 2022 |
| channel2 | Feb 10, 2022 |
Now that you know how to fetch and display the date you started following each Twitch channel, you can enhance your Twitch experience with this useful information. Happy streaming!