Today the layout of the user profile page has changed. I haven't found any information on MSO about it.
Now that it's gone, how can we find "last seen" and "profile views" information in profiles?
And those blanks are also a little uncomfortable:
Stack Exchange API provides a way to get this information through the /users/{ids} endpoint:
const endpoint = "https://api.stackexchange.com/2.3/users/";
$(btn).on('click', function() {
const params = "?order=desc&site=" + sitename.value + "&filter=!40D72h-7nG92Z1_td";
const url = endpoint + userid.value + params;
$.get(url, function(response) {
if (response.items.length == 0) {
$(result).html("No user with that id found");
} else {
const userData = response.items[0];
const lastSeen = new Date(userData.last_access_date * 1000);
const viewCount = userData.view_count;
const joinDate = new Date(userData.creation_date * 1000);
$(result).html("Last seen: " + lastSeen.toLocaleString() + "<br>Profile views: " + viewCount + "<br>Member since: " + joinDate.toLocaleString());
}
})
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
Sitename: <input placeholder="site-name" id="sitename" value="stackoverflow">
<br/><br/> User ID: <input type="number" placeholder="user-id" id="userid">
<button id="btn">Check</button>
<hr>
<div id="result"></div>
A userscript that I wrote (LegacyProfiles) is available that automatically loads this information when you view a user's profile.
Last seen
Info back, that's useful (needed!) Info for Answerers to deal with the Follow-up from Askers... (and to be more patient), and I had "forgotten" about the Profile Views
, ah-ah...! // Script in v2.2. is quite different from the one posted in this Answer, I might "tweak" it to display the Date in International Format (2022-06-05
) rather than the current "06/05/2022
", + split the long Lines to make the Script a bit more readable without Horizontal Scrolling, but it works nicely... // How much is the API Limit
btw...?
OAuth Domain
and Enable Client Side OAuth Flow
, but I haven't read any Documentation yet... // And hum, the "Default" Script v2.2. already contains an API Key ("LRILX...
"), so I guess all Users using the "Default" Script share the 10,000 Calls for that Default API Key together... OK, I'll "see" with more Practice if I need to register a "Personal" API Key..., or 300 would already be more than enough for myself alone... That's per Day I reckon...
Here’s a solution for last seen:
In the user’s profile, click on "network profile" in the top right and then look at their accounts tab. This won’t show the exact time of day they visited, and I don’t think all users have a network profile, but it’s something.
Here’s yours, for an example: https://stackexchange.com/users/16353407/jizhihaosama?tab=accounts
bug
andfeature-request
tags) until the recent changes to the Profile Page are reverted.