This is probably something obvious that I just haven't noticed, but how does SO know who shared a link to a post?
The ,
, and
badges all seem to be able to track who shared the link.
This is probably something obvious that I just haven't noticed, but how does SO know who shared a link to a post?
The ,
, and
badges all seem to be able to track who shared the link.
The share link includes your userid. My share link for your question is:
http://meta.stackoverflow.com/q/274712/100297
# ------ ^^^^^^
274712 is the question id, 100297 is my userid on Stack Overflow and Meta Stack Overflow.
Answers have similar links; the id for this answer is 274713, so the share link for this answer, customised for me, is:
http://meta.stackoverflow.com/a/274713/100297
The only difference then with the question link is that the URL path starts with /a
instead of /q
.
Both link types then redirect to the full question or answer URLs:
$ curl -s -D - -o /dev/null http://meta.stackoverflow.com/q/274712/100297 | grep Location
Location: http://meta.stackoverflow.com/questions/274712/how-does-the-announcer-badge-and-similar-badges-know-who-shared-the-link
$ curl -s -D - -o /dev/null http://meta.stackoverflow.com/a/274713/100297 | grep Location
Location: http://meta.stackoverflow.com/questions/274712/how-does-the-announcer-badge-and-similar-badges-know-who-shared-the-link/274713#274713
The site knows what question an answer belongs to, so the URL for an answer is the same as for the parent question but with /<answerid>#<answerid>
tacked onto the end.
http://meta.stackoverflow.com/q/274712
still works too.