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