]> git.vanrenterghem.biz Git - www2.vanrenterghem.biz.git/blob - posts/sending_pingback_oldskool_indieweb.mdwn
5bda94dcee8e69be3a589143dbc98a4618ad2507
[www2.vanrenterghem.biz.git] / posts / sending_pingback_oldskool_indieweb.mdwn
1 [[!meta title="About sending pingbacks, webmentions and some thoughts on how to improve on them."]]
2 [[!tag indieweb blogging open_web]]
3 [[!meta date="2023-10-31T20:41:30+08:00"]]
4  
5 In a 'blast from the past', I sent my first [pingback](https://www.hixie.ch/specs/pingback/pingback) after writing the [[previous post|agent based models digital twins]]. A pingback is a way for a blogger to send a message to another blogger, informing them they've written a post that refers to theirs, e.g. as a reply or an extension of the ideas raised.
7 The process is a bit more involved than using a [webmention](https://www.w3.org/TR/webmention/), which I've used before and [[implemented support for|Implementing webmention on my blog]] a while back, due to requiring an XML message to be created rather than a simple exchange of URLs.
9 First, I created a file `pingback.xml` containing the URLs of the blog post I wrote and the one I made reference to within my post. The standard defines the schema, resulting in the following:
11 [[!format xml """
12 <?xml version="1.0" encoding="UTF-8"?>
13 <methodCall>
14     <methodName>pingback.ping</methodName>
15     <params>
16         <param>
17             <value><string>https://www.vanrenterghem.biz/blog/posts/agent_based_models_digital_twins/</string></value>
18         </param>
19         <param>
20             <value><string>https://johncarlosbaez.wordpress.com/2023/10/25/software-for-compositional-modeling-in-epidemiology/</string></value>
21         </param>
22     </params>
23 </methodCall>
24 """]]
26 Next, I used `curl` on the command-line to send this file in a POST request to Wordpress's pingback service. I had to use the `-k` option to make this work - bypassing verification of the TLS certificate.
28 [[!format sh """
29 curl -k https://johncarlosbaez.wordpress.com/xmlrpc.php -d @pingback.xml
30 """]]
32 In a sign things were going well, I saw the following appear in my website's access log:
34 [[!format txt """
35 192.0.112.141 - - [29/Oct/2023:09:35:06 +0100] "GET /blog/posts/agent_based_models_digital_twins/ HTTP/1.1" 200 2676 "https://www.vanrenterghem.biz/blog/posts/agent_based_models_digital_twins/" "WordPress.com; https://johncarlosbaez.wordpress.com; verifying pingback from 139.216.235.49"
36 """]]
38 Finally, I received the following response to my `curl` request on the command-line:
40 [[!format xml """
41 <?xml version="1.0" encoding="UTF-8"?>
42 <methodResponse>
43   <params>
44     <param>
45       <value>
46       <string>Pingback from https://www.vanrenterghem.biz/blog/posts/agent_based_models_digital_twins/ to https://johncarlosbaez.wordpress.com/2023/10/25/software-for-compositional-modeling-in-epidemiology/ registered. Keep the web talking! :-)</string>
47       </value>
48     </param>
49   </params>
50 </methodResponse>
51 """]]
53 That "Keep the web talking! :-)" message made me smile.
55 In order to understand a bit better how things were being processed, I checked the Wordpress code for its pingback service, and it appears they [take the title of the linked article as the author](https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-wp-xmlrpc-server.php?rev=56637#L7040), which seems a bit odd. The pingback standard didn't allow for anything but the swapping out of links though. How your reference is summarized on the referred site is entirely left to recipient - who may process pingbacks manually or use a service automating (parts of) the processing. 
57 Wordpress processes pingbacks automatically, turning them into comments on the original post. As the comment text, [Wordpress uses the link text in the anchor element](https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-wp-xmlrpc-server.php?rev=56637#L7036) with a horizontal ellipsis around it, and some filtering to prevent the comment from being too long. It's odd how the standard didn't define further approaches to make this a bit easier. A pingback attribute in the anchor element would have been helpful for instance, as we could put some text in there to summarise our page when the pingback is processed automatically. Most surprisingly maybe, with the benefit of hindsight, it would have been interesting had the subsequent standard that emerged, Webmention, implemented some further enhancements. [Aaron Parecki](https://aaronparecki.com/), author of the Webmention W3C Recommendation, might know if that was ever considered, or just not within the use case for pingbacks / webmentions? There seemed to have been [some thought put into it in 2019](https://aaronparecki.com/2019/10/15/26/) at least.