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