Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support linkbacks as in the blogosphere #109

Open
archusr opened this issue Mar 6, 2016 · 13 comments
Open

Support linkbacks as in the blogosphere #109

archusr opened this issue Mar 6, 2016 · 13 comments
Milestone

Comments

@archusr
Copy link

archusr commented Mar 6, 2016

Consider two users foo (https://foo.org/twtxt.txt) and bar (https://bar.org/twtxt.txt).

When user foo mentions user bar in her tweet, the client could call the linkback url as defined in bar's metadata (#22 #48), e.g. https://bar.org/twtxt/ping.php?url=https://foo.org/twtxt.txt&name=foo (name optional?)

ping.php would log the request to https://bar.org/twtxt/ping.txt (linkback log) as in:
2016-03-06T11:12:25+01:00 <@foo https://foo.org/twtxt.txt> mentioned you.

As user bar is subscribed to her linkback log she'd see the mention in her timeline.

Similar to pingback/trackback as in blogs, cf. https://en.wikipedia.org/wiki/Linkback. Sorry, if you already thought of all this.

Exemplary ping.php to write the linkback log ping.txt

$line = date('Y-m-d\TH:i:sP')."\t"."<@$_GET['name'] $_GET['url']> mentioned you.";
$fh = fopen('ping.txt','a'); fwrite($fh, $line."\n"); fclose($fh);
@mdom
Copy link
Contributor

mdom commented Mar 6, 2016

If user foo is registered at a registry, user bar could just query for mentions to see foo's tweet. Although i think it would be very nice to have a linkback plugin if a plugin system is ever added.

@archusr
Copy link
Author

archusr commented Mar 6, 2016

Ah, registries, thanks for pointing that out. It's a bit opposing the idea of decentralization, though.

@mdom
Copy link
Contributor

mdom commented Mar 6, 2016

The plan is to have multiple registries than can exchange their data. You would always be able to run your own registry.

@timofurrer
Copy link
Contributor

I really like the idea of of the linkback - it must be optional though: if the linkback call fails it doesn't matter.

Ah, registries, thanks for pointing that out. It's a bit opposing the idea of decentralization, though.

I agree with that.

@mdom
Copy link
Contributor

mdom commented Mar 11, 2016

Yeah, you're right. I implemented basic support for Linkback in txtnix. Maybe we can discuss here what a twtxt client should send to a linkback URL. Is the URL enough? Anything else the endpoint would need? Should the endpoint check if user foo really mentioned user bar and only then write to the linkback log? Do you have an logback log we could play with archuser? But in the end it all hinges on our answer to #48.

@archusr
Copy link
Author

archusr commented Mar 11, 2016

Great, I like it a lot. I want to suggest:

  • LinkBack must send the url, should send the name (and may send the tweet?)
  • The endpoint should check foo's tweets for the mention to avoid spam, but that might be simply up to the implementation.

[edit]: Not sure about also sending the tweet itself (for emailing), as the endpoint can retrieve it by itself to process/mail it etc.

@DracoBlue
Copy link
Contributor

👍

Url of the twtxt.txt should be sifficient. Nick and real content of the tweet can be retrieved by the client ondemand.

So it is more like a ping ;)

@archusr
Copy link
Author

archusr commented Mar 13, 2016

You're right, URL is enough. Here's my initial ping.php (working for me ;).

edit 2016-03-14:
For simple testing purposes here's a ping endpoint that allows to set a mentioningurl as if it was your ping endpoint, e.g. foo mentions bar:

curl -XPOST https://post.aldebaran.uberspace.de/twtxt/ping/test/ -d url=https://foo.org/twtxt.txt -d mentioningurl=https://bar.org/twtxt.txt

(So, basically user sending the ping/source is "url", while "mentioningurl" is the mentioned target user.)
Note, that the content from url is retrieved to search for the mentioningurl.

The calls are recorded into this twtxt: http://post.aldebaran.uberspace.de/twtxt/ping/test/pingtest.txt

@buckket buckket added this to the 1.3.0 milestone Mar 24, 2016
@Puddinglord
Copy link

I have a question for archusr, I am a college student working with a group that was going to work on this feature for a class, I see you have ping.php so would the link-back mention still be applicable to work on?

@archusr
Copy link
Author

archusr commented Apr 4, 2016

Hi @Puddinglord, thanks for your interest and support. The ping.php is just a simple/sample ping backend/receiver. At the moment, txtnix is the first and only twtxt client to support linkbacks. I'm not sure if @buckket is interested in working code for twtxt -- which could be a nice project from my point of view, and I definately would be happy to see it :)

@Zegnat
Copy link

Zegnat commented Apr 11, 2017

Just driving by and wanted to drop in and point people at Webmention, the latest W3C Recommendation for “a simple way to notify any URL when you mention it on your site”.

The syntax is basically as described by @archusr in #109 (comment), except the parameters are called source and target.

@kixiQu
Copy link

kixiQu commented Jan 5, 2021

The change would be that the webmention endpoint would have to be discoverable.

The sender must fetch the target URL (and follow redirects [FETCH]) and check for an HTTP Link header [RFC5988] with a rel value of webmention. If the content type of the document is HTML, then the sender must look for an HTML and element with a rel value of webmention. If more than one of these is present, the first HTTP Link header takes precedence, followed by the first or element in document order. Senders must support all three options and fall back in this order.

webmention spec

Adding a Link header is possible for anyone who's willing to fiddle with their web server, but isn't straightforward otherwise.

@zzo38
Copy link

zzo38 commented Jul 6, 2022

If you want to reference a specific message (e.g. to reply to a question that it asks), then how are you supposed to know which message you are referencing? It seems to me that doing that would be more useful than merely a mention of the user name, which isn't very helpful in my opinion.

@buckket buckket modified the milestones: 1.3.0, 2.0.0 Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants