GithubHelp home page GithubHelp logo

aaronpk / webmention.io Goto Github PK

View Code? Open in Web Editor NEW
760.0 21.0 38.0 1.98 MB

Easily enable webmentions on any web site

Home Page: https://webmention.io/

License: Other

Ruby 60.42% CSS 5.66% JavaScript 2.13% Shell 0.04% HTML 31.75%
webmention indieweb

webmention.io's Introduction

Webmention.io

This project is an implementation of the Webmention protocol. It allows the webmention receiving service to be run separately from the blogging software or website environment, making it easier to manage and integrate with other services.

Say you have a statically-generated website using Jekyll or something similar, you can add the appropriate <link> tag pointing to this service, and now you have Webmentions enabled on your static site!

<link rel="webmention" href="https://webmention.io/example.com/webmention" />

The Webmention protocol also supports specifying the endpoint in the headers,

Link: <https://webmention.io/example.com/webmention>; rel="webmention"

Features

  • Accept Webmentions for any site by adding an html tag: <link rel="webmention" href="https://webmention.io/example.com/webmention" />
  • API to get a list of pages linking to your site or a specific page
  • If you want to receive Pingbacks on your site but don't want to deal with XMLRPC, then you can use this service to convert Pingbacks to Webmentions

API

Find links to a specific page

This service provides an API for returning a list of pages that have linked to a given page. For example:

GET https://webmention.io/api/mentions.jf2?target=https://indieweb.org

{
  "type": "feed",
  "name": "Webmentions",
  "children": [
    {
      "type": "entry",
      "author": {
        "type": "card",
        "name": "Tantek Çelik",
        "url": "http://tantek.com/",
        "photo": "http://tantek.com/logo.jpg"
      },
      "url": "http://tantek.com/2013/112/t2/milestone-show-indieweb-comments-h-entry-pingback",
      "published": "2013-04-22T15:03:00-07:00",
      "wm-received": "2013-04-25T17:09:33-07:00",
      "wm-id": 900,
      "content": {
        "text": "Another milestone: @eschnou automatically shows #indieweb comments with h-entry sent via pingback http://eschnou.com/entry/testing-indieweb-federation-with-waterpigscouk-aaronpareckicom-and--62-24908.html",
        "html": "Another milestone: &lt;a href=\"https:\/\/twitter.com\/eschnou\">@eschnou&lt;\/a> automatically shows #indieweb comments with h-entry sent via pingback &lt;a href=\"http:\/\/eschnou.com\/entry\/testing-indieweb-federation-with-waterpigscouk-aaronpareckicom-and--62-24908.html\">http:\/\/eschnou.com\/entry\/testing-indieweb-federation-with-waterpigscouk-aaronpareckicom-and--62-24908.html&lt;\/a>"
      }
    }
  ]
}

Find links of a specific type to a specific page

You can include a parameter to limit the returned links to mentions of a specific type:

GET https://webmention.io/api/mentions.jf2?target=https://indieweb.org&wm-property=in-reply-to

or request multiple types by repeating the query parameter:

GET https://webmention.io/api/mentions.jf2?target=https://indieweb.org&wm-property[]=in-reply-to&wm-property[]=rsvp

The full list of recognized properties is below:

  • in-reply-to
  • like-of
  • repost-of
  • bookmark-of
  • mention-of
  • rsvp

Find links to multiple pages

This is useful for retrieving mentions from a post if you've changed the URL.

GET https://webmention.io/api/mentions.jf2?target[]=https://indieweb.org/a-blog-post&target[]=https://indieweb.org/a-different-post

Find all links to your domain

You can also find all links to your domain:

GET https://webmention.io/api/mentions.jf2?domain=indiewebcamp.com&token=xxxxx

(You will see your account's token when you sign in.)

You can optionally add a since parameter to return new webmentions as of a certain date. This is useful to poll for new webmentions you haven't seen yet.

GET https://webmention.io/api/mentions.jf2?domain=indiewebcamp.com&token=xxxxx&since=2017-06-01T10:00:00-0700

Find all links to all sites in your account

With no parameters, the API will return all links to any site in your account:

GET https://webmention.io/api/mentions?token=xxxxxx

Sorting

You can choose the sorting mechanism to return the list of mentions. The following options are supported:

  • sort-by=created (default) - Sort by the date the mention was created in the webmention.io database.
  • sort-by=updated - Sort by the updated date of the page, as seen by webmention.io (not the date the post reports in its microformats data).
  • sort-by=published - Sort by the published date as reported by the linking page. Some pages don't include published date so this will fall back to created date if published is not present.
  • sort-by=rsvp - Sort by RSVP value, in the following order: "no", "interested", "maybe", "yes".

By default, results are returned in descending order. You can control the ordering with the sort-dir parameter:

  • sort-dir=down (default) - Newest first, RSVP "yes" first
  • sort-dir=up - Oldest first, RSVP "no" first

Paging

Basic paging is supported by using the per-page and page parameters. For example,

  • ?per-page=20&page=0 first page of 20 results
  • ?per-page=20&page=1 second page of 20 results

The default number of results per page is 20. Results are always sorted newest first.

Finding New Mentions

You can use the since or since_id parameters to find new mentions retrieved by the service.

  • since=2017-06-01T10:00:00-0700 - pass a full timestamp to the since parameter to return links created after that date. This corresponds to the date the link was created in the webmention.io service, not the published date that the page reports.
  • since_id=1000 - pass an ID to return links with a greater ID

JSONP

The API also supports JSONP so you can use it to show pingbacks on your own sites via JavaScript. Simply add a parameter jsonp to the API call, for example, https://webmention.io/api/mentions.jf2?jsonp=f&target=https%3A%2F%2Fwebmention.io

Atom

You can change /mentions to /mentions.atom to receive your results in the Atom format:

GET https://webmention.io/api/mentions.atom?token=xxxxxx

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>https://webmention.io/api/mentions.atom</id>
  <title>Mentions</title>
  <updated>2013-04-25T17:09:33-07:00</updated>
  <link href="https://webmention.io/api/mentions.atom"/>
  <author>
    <name>webmention.io</name>
  </author>
  <entry>
    <title>tantek.com mentioned /webmention</title>
    <id>https://webmention.io/api/mention/8675309</id>
    <summary>http://tantek.com/2013/113/b1/first-federated-indieweb-comment-thread mentioned http://indiewebcamp.com/webmention</summary>
    <updated>2013-04-25T17:09:33-07:00</updated>
    <content type="xhtml" xml:lang="en">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p><a href="http://tantek.com/2013/113/b1/first-federated-indieweb-comment-thread">http://tantek.com/2013/113/b1/first-federated-indieweb-comment-thread</a> mentioned <a href="http://indiewebcamp.com/webmention">http://indiewebcamp.com/webmention</a></p>
      </div>
    </content>
  </entry>
</feed>

About the Pingback Protocol

The pingback system is a way for a blog to be automatically notified when other Web sites link to it. It is entirely transparent to the linking author, requiring no user intervention to work, and operates on principles of automatic discovery of everything that it needs to know.

A sample blog post involving pingback might go like this:

  • Alice posts to her blog. The post she's made includes a link to a post on Bob's blog.
  • Alice's blogging system contacts Bob's blogging system and says "look, Alice made a post which linked to one of your posts".
  • Bob's blogging system then includes a link back to Alice's post on his original post.
  • Reader's of Bob's article can follow this link to Alice's post to read her opinion.

Read the full protocol here: http://www.hixie.ch/specs/pingback/pingback

Pingback to Webmention Service

Webmention is a modern alternative to Pingback. It's analogous to the Pingback protocol except does not use XML-RPC and is much easier to implement. This project also includes a simple API for converting XML-RPC Pingbacks to Webmentions and forwarding the request on to your own site.

Using Webmention.io in this mode does not require an registration, and this service does not store any of the information. The Pingback request is simply forwarded on to your server as a Webmention.

To use, add a Pingback header like the following:

<link rel="pingback" href="https://webmention.io/webmention?forward=https://example.com/webmention" />

Any Pingbacks received will be forwarded on to the specified Webmention endpoint. It is up to you to handle the Webmention and return an expected result. The Webmention result will be converted to a Pingback result and passed back to the sender.

Full Example

A blog links to your site, makes a GET request for the page to retrieve the Pingback header

GET http://example.com/post/1000

<html>
  <head>
    <title>Example Post 1000</title>
    <link rel="pingback" href="https://webmention.io/webmention?forward=http://example.com/webmention" />
    ...

The blog sends a Pingback request to webmention.io

POST https://webmention.io/webmention?forward=http://example.com/webmention
Content-Type: application/xml

<?xml version="1.0" ?>
<methodCall>
  <methodName>pingback.ping</methodName>
  <params>
    <param>
      <value>
        <string>http://aaronparecki.com/notes/2013/02/16/1/little-printer</string>
      </value>
    </param>
    <param>
      <value>
        <string>http://example.com/post/1000</string>
      </value>
    </param>
  </params>
</methodCall>

The webmention.io server forwards this on to your site as a Webmention

POST http://example.com/webmention
Content-Type: application/x-www-url-form-encoded

source=https://aaronparecki.com/2013/02/16/2/little-printer&
target=http://example.com/post/1000

Your server replies with a Webmention response indicating success

HTTP/1.1 202 Accepted
Content-Type: application/json

{
  "result": "Webmention was successful"
}

Webmention.io converts this to a Pingback success reply and sends it back to the original blog

HTTP/1.1 200 OK
Content-Type: application/xml

<?xml version="1.0" ?>
<methodResponse>
  <params>
    <param>
      <value>
        <string>Pingback from https://aaronparecki.com/2013/02/16/2/little-printer to http://example.com/post/1000 was successful!</string>
      </value>
    </param>
  </params>
</methodResponse>

Errors

Webmention errors are converted to Pingback errors as well! For example,

{
  "error": "no_link_found"
}

Is converted to:

<?xml version="1.0" ?>
<methodResponse>
  <fault>
    <value>
      <struct>
        <member>
          <name>faultCode</name>
          <value><i4>17</i4></value>
        </member>
        <member>
          <name>faultString</name>
          <value>
            <string>no_link_found</string>
          </value>
        </member>
      </struct>
    </value>
  </fault>
</methodResponse>

You can start using this right now to quickly handle Pingbacks as Webmentions on your own domain. This is a way to bootstrap the Webmention protocol until more services adopt it.

Development

First, check your Ruby version. 2.0.0 does not work; details below. Try 1.9.3 or anything >=2.1.3 instead, they should work. Here are minimal instructions for Mac OS X, using Homebrew, ruby-install, and chruby:

brew install ruby-install chruby libxml2 libxslt
ruby-install ruby 2.1.6
source /usr/local/opt/chruby/share/chruby/chruby.sh
chruby 2.1.6
gem install bundler

Now, run these commands to set up your environment and start the server locally:

bundle install
cp config.yml.template config.yml
mysql -u root -e 'CREATE USER webmention@localhost IDENTIFIED BY "webmention"; CREATE DATABASE webmention; GRANT ALL ON webmention.* TO webmention@localhost; FLUSH PRIVILEGES;'
export RACK_ENV=development
bundle exec rake db:bootstrap
./start.sh

Now open http://localhost:9019/ and check that you see the front page. You can also run bundle exec rake test:sample1 to send a test pingback.

Troubleshooting

If bundle install dies like this while compiling libxml-ruby:

...
ruby_xml_node.c:624:56: error: incomplete definition of type 'struct _xmlBuf'
    result = rxml_new_cstr((const char*) output->buffer->content, xencoding);
                                         ~~~~~~~~~~~~~~^
...
An error occurred while installing libxml-ruby (2.3.3), and Bundler cannot continue.
Make sure that `gem install libxml-ruby -v '2.3.3'` succeeds before bundling.

You're in...um...a weird state. You probably have an old version of the repo checked out with a Gemfile.lock that asks for libxml-ruby 2.3.3, which is incompatible with your system's libxml2 2.9.x. HEAD fixes this by asking for libxml-ruby 2.6.0. git pull and then rerun bundle install.

If bundle install dies with this message in the middle of its error output:

/.../lib/ruby/2.0.0/tmpdir.rb:92:in `mktmpdir': parent directory is world writable but not sticky (ArgumentError)

...you can fix this with either chmod +t $TMPDIR or (better) chmod 700 $TMPDIR. Evidently this problem is common on Mac OS X.

When you open the front page, if you see an error that includes Library not loaded: libmysqlclient.18.dylib, your MySQL shared libraries may not be installed at a standard location, e.g. if you installed MySQL via Homebrew. Try DYLD_LIBRARY_PATH=/usr/local/mysql/lib ./start.sh (or wherever your MySQL libraries are located).

Ruby 2.0.0 woes

If rake db:bootstrap raises an TypeError: no implicit conversion from nil to integer exception in quoting.rb, you've hit this Ruby 2.0.0 bug/incompatibility. Use a different Ruby version.

If rake db:bootstrap hangs while attempting to create the links table , Ruby 2.0.0 strikes again! Use a different version. (You won't see progress details per table by default; it'll just hang.)

If bundle exec rake ... complains Could not find rake-10.4.0 in any of the sources, and you run bundle install and bundle check and they're both happy, and vendor/bundle/ruby/2.0.0/gems/rake-10.4.0/ exists...Ruby 2.0.0 strikes again. (Maybe?) Use a different version.

Monitoring

This server collects stats on its own, caches in Redis, and provides a Munin plugin to retrieve the stats.

Counts that are tracked, one graph for webmention, another for pingback

  • success
  • dns_error
  • connect_error
  • timeout
  • ssl_error
  • ssl_cert_error
  • ssl_unsupported_cipher
  • too_many_redirects
  • no_content
  • invalid_content
  • no_link_found
  • unknown_error

FAQ

Is there a way to replay webhooks

Q: Is there a way to replay webhooks from webmention.io?

A: In short no, however you should be able to get the same data from the API, and make sure you use the .jf2 URLs instead of .json since that's the format it uses for the webhook.

License

Copyright 2018-2024 by Aaron Parecki.

Available under the BSD License. See LICENSE.txt

webmention.io's People

Contributors

aaronpk avatar anderspitman avatar bdesham avatar btrem avatar coliff avatar ibudiallo avatar jamietanna avatar josephrexme avatar kleinfreund avatar poorchop avatar purplekarrot avatar saulhardman avatar snarfed avatar strugee avatar tantek avatar tribut avatar victoriadrake avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webmention.io's Issues

API: include uid in returned data

we noticed today that /api/mentions.json doesn't return the uid property to clients. this is unfortunate because it makes some clients (e.g. https://waterpigs.co.uk/services/webmention-io-comments/ , http://stream.thatmustbe.us/ ) fall back to de-duping on url, which is usually unique, but not always.

specifically, most silos don't have unique permalinks for likes or comments, so bridgy often uses the post's url, which will obviously be shared across its comments and/or likes. bridgy sometimes fabricates synthetic unique permalinks (snarfed/bridgy#215), but not consistently for all responses yet.

fwiw, the mf2, mf1, and hCard/vCard specs/wiki all consistently say that uid should be (universally) unique, but not that url necessarily has to be.

cc @dissolve @tantek @kevinmarks

Missing values for nested h-entry

This issue doesn't really belong here because I think it's a bug/not-yet-implemented in the Ruby parser, but it's affecting my mentions received at webmention.io so I'm putting it here for now anyway.

When a wm is received from a h-entry that is nested as a child of another, it is verified okay but the url, content, name, author, etc aren't picked up, see: http://webmention.io/api/mentions?target=http://rhiaro.co.uk/2015/08/threaded-replies

ie. This happens if a reply is in a thread, and doesn't have a permalink where it's the top level h-entry.

The PHP parser picks up the microformats just fine: http://pin13.net/mf2/?url=http://csarven.ca/webmention#comment-20150811094822 (ctrl+f for the comment id to jump to it..)

According to the Ruby parser, "Not Implemented: nested microformat without associated property", but adding a property like u-comment to the h-entry of the threaded replies didn't help either.

activity: subfields, published data, name, content are all null

context:

Entry:

    {
      "source": "https:\/\/petermolnar.eu\/re-digital-memories\/",
      "verified": true,
      "verified_date": "2015-11-11T11:33:17+00:00",
      "id": 143204,
      "data": {
        "author": {
          "name": "Peter Molnar",
          "url": "https:\/\/petermolnar.eu\/",
          "photo": null
        },
        "url": "https:\/\/petermolnar.eu\/re-digital-memories\/",
        "name": null,
        "content": null,
        "published": null,
        "published_ts": null
      },
      "activity": {
        "type": null,
        "sentence": null,
        "sentence_html": null
      },
      "target": "http:\/\/rhiaro.co.uk\/2015\/07\/digital-memories"
    },

The reply page did and does contain valid, parse able mf2 data, including u-in-reply-to; something is off parsing my page.

Please poke me if I can help finding the issue.

nice text for bridgy invite notifications

most of bridgy's interaction notifications have nice text now, but invites are still the ugly exception. we should fix that!

e.g. from http://indiewebcamp.com/irc/2015-03-24#t1427214665792 :

[bridgy] https://www.facebook.com/1565113317092307#10152740287428542 was invited to https://indiewebcamp.com/events/2015-03-25-homebrew-website-club
[bridgy] Kyle Huey RSVPed no to https://indiewebcamp.com/events/2015-03-25-homebrew-website-club (https://www.facebook.com/1565113317092307#10204181889683168)

doesn't follow redirects (e.g. t.co links)

(Moving this issue from here: https://github.com/aaronpk/self/issues/3#issuecomment-66829659)

Also, webmention.io doesn't follow redirects (e.g. t.co links):

$ curl -i -d 'source=https://twitter.com/TheRealDod/status/543499670673031169&target=https://zzzen.com/420/' https://webmention.io/zzzen.com/webmention
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Content-Length: 104
Connection: keep-alive
Status: 400 Bad Request
Cache-Control: no-store
X-Content-Type-Options: nosniff
X-Powered-By: Phusion Passenger 4.0.38
Date: Fri, 12 Dec 2014 20:19:49 GMT
Server: nginx/1.4.6 + Phusion Passenger 4.0.38

{"error":"no_link_found","error_description":"The source URI does not contain a link to the target URI"}

Webmentionned in a reply to another link

When a post contains something like <a class="in-reply-to">Foo</a> <a>Webmention.io</a>, which means it is a reply to Foo, Webmention.io sees itself as the reply target if it is webmentioned.

For example, this article contains a in-reply-to link toward http://slopjong.de/2012/03/31/curl-follow-locations-with-safe_mode-enabled-or-open_basedir-set/ and, in another sentences, mentions http://indiewebcamp.com/php-mf2. IndieWeb considers the post as a reply to http://indiewebcamp.com/php-mf2 although this is not the case.

It should say "Élie Michel posted a comment that linked to indiewebcamp.com" instead of "Élie Michel commented on https://indiewebcamp.com".

not seeing some brid.gy source URLs

not sure of the root cause yet, but webmention.io returns 400 'The source URI does not exist' on at least some brid.gy webmentions. here's an example:

source: https://www.brid.gy/like/twitter/aaronpk/418251719303495680/14447132
target: http://ttk.me/t4Tq3
full log: https://www.brid.gy/log?start_time=1388621265&key=aglzfmJyaWQtZ3lySwsSCFJlc3BvbnNlIj10YWc6dHdpdHRlci5jb20sMjAxMzo0MTgyNTE3MTkzMDM0OTU2ODBfZmF2b3JpdGVkX2J5XzE0NDQ3MTMyDA

a couple guesses:

  • does webmention.io cache source fetches? if so, maybe brid.gy choked the first time webmention.io asked for it, and it hasn't retried?
  • the brid.gy URL is served over SSL but has mixed content due to the profile picture. (i'll fix that soon.) maybe webmention.io is picky?

missing data from bridgy mentions

this twitter reply (and some other replys and likes)
https://twitter.com/Nevid/status/637019490241392640
https://brid-gy.appspot.com/comment/twitter/diplix/637001027972022272/637019490241392640

produce mentions with missing data at webmention.io
http://webmention.io/api/mentions?perPage=200&page=0&target[]=http://wirres.net/article/articleview/8434/1/6/

{"source":"https://brid-gy.appspot.com/comment/twitter/diplix/637001027972022272/637019490241392640","verified":true,"verified_date":"2015-08-27T21:51:38+00:00","id":92696,"data":{"url":null,"author":{"name":"David Prochnow","url":"http://www.davidp.de/","photo":"https://twitter.com/Nevid/profile_image?size=original"},"name":null,"content":null,"published":null,"published_ts":null},"activity":{"type":null,"sentence":null,"sentence_html":null},"target":"http://wirres.net/article/articleview/8434/1/6/"}

→ note that data:url and activity:type are is missing/null, although bridgy provides all necessary data.

this seems to be happening only since yesterday evening (CET), starting about 10 to 12 hours from now.

sending the mention again, does not seem to update the webmention.io data

curl -i -d "source=https://brid-gy.appspot.com/comment/twitter/diplix/637001027972022272/637019490241392640&target=http://wirres.net/article/articleview/8434/1/6/" https://webmention.io/wirres.net/webmention

http://webmention.io/api/mentions?perPage=200&page=0&target[]=http://wirres.net/article/articleview/8434/1/6/

"empty" webmentions

As mentioned here, I tried to webmention from github, got a 202, and nothing happened.

I tried again now, got the 202 below,

$ curl -i \
  -d 'source=https://github.com/aaronpk/self/issues/3&target=https://zzzen.com/420/' \
  https://webmention.io/zzzen.com/webmention
HTTP/1.1 202 Accepted
Content-Type: application/json;charset=UTF-8
Content-Length: 38
Connection: keep-alive
Status: 202 Accepted
Cache-Control: no-store
Access-Control-Allow-Origin: *
X-Content-Type-Options: nosniff
X-Powered-By: Phusion Passenger 4.0.38
Date: Sun, 14 Dec 2014 04:48:04 GMT
Server: nginx/1.4.6 + Phusion Passenger 4.0.38

but this time (4 days and many commits later), it does appear, but both this webmention and the one preceding it (which was fine yesterday) don't have name, content or URL in the JSON:

        {
            "activity": {
                "sentence": null,
                "sentence_html": null,
                "type": null
            },
            "data": {
                "content": null,
                "name": null,
                "published": null,
                "published_ts": null,
                "url": null
            },
            "id": 12652,
            "source": "http://indiewebcamp.com/irc/2014-12-12/line/1418415395410",
            "target": "https://zzzen.com/420/",
            "verified": true,
            "verified_date": "2014-12-12T20:39:04+00:00"
        },
        {
            "activity": {
                "sentence": null,
                "sentence_html": null,
                "type": null
            },
            "data": {
                "content": null,
                "name": null,
                "published": null,
                "published_ts": null,
                "url": null
            },
            "id": 12613,
            "source": "https://github.com/aaronpk/self/issues/3",
            "target": "https://zzzen.com/420/",
            "verified": true,
            "verified_date": "2014-12-14T04:48:04+00:00"
        },

CORS enabled API

I was wondering if you knew if CORS is enabled for the pingback.me api?

Doing a curl like:

$  curl -i http://pingback.me/api/links?target=http://bret.io/2013/07/25/t1/&jsonp=webMention.elements[1].postProcess -H "Origin: http://bret.io" -X OPTIONS

Returns

X-XSS-Protection: 1; mode=block

So it looks like it is on? I'm not sure since I don't fully comprehend XHR calls yet so its slow for me to experiment.

If the API does not allow CORS, would it be possible to enable it? If its already on I'll switch over to that.

Right now I am running up against JSONP limitations, which lacks any kind of error handling for 404s and other error codes.

'undefined method' exception on mf2 fields that aren't returned by inline parser

example log below. i'll take this one.

Verifying link exists from https://brid-gy.appspot.com/like/twitter/aaronpk/540572350568091649/68474641 to https://aaronparecki.com/notes/2014/12/04/1/starbucks
Error while parsing microformats undefined method `published' for #<HEntry:0x007f9bfe3195d8>
/Users/ryan/src/webmention.io/controllers/webmention.rb:200:in `process_mention'
/Users/ryan/src/webmention.io/controllers/webmention.rb:20:in `block in <class:Controller>'

Receiving 403 errors when retrieving data with JSONP

Whenever I try to place a script into my DOM with JSONP, I get a 403 error from the server.

Is this because of the API key? I get the 403 even with the access token as a parameter.

Also, I have a few other personal account issues I need help with, maybe you can help me with on IRC at some point when you are working on this stuff.

handle u-url

looking at the API output, data.url seems to always get set to the source URL. it'd be nice if it was set to u-url instead, if available.

example source mf2 snippet from this bridgy twitter favorite:

<article class="h-entry h-as-like">
  <div class="p-name"><a class="u-url" href="https://twitter.com/AaronGustafson/status/534866325160878080">ĎÚβĨŐÚŚ Dod favorited this.</a></div>
  ...

the webmention.io API returns this output:

{
  "source": "https://brid-gy.appspot.com/like/twitter/AaronGustafson/534866325160878080/39007560",
  "id": 11876,
  "data": {
    "url": "https://brid-gy.appspot.com/like/twitter/AaronGustafson/534866325160878080/39007560",
    "name": "ĎÚβĨŐÚŚ Dod favorited this.",
    "content": "favorited this."
    ...

since_id parameter (feature)

It would be nice if /api/links supported a since_id parameter, in order to return links with id greater than last_id.

My use case: I have a static blog. I want to poll webmention.io periodically for mentions to my pages (using ?domain=). It would make my life much easier, and probably take some of the server load too, if I could ask for links with ID greater than the last ID I got last time I checked.

This is how twitter does it, see https://dev.twitter.com/docs/api/1.1/get/search/tweets and the since_id parameter.

Catch XML parse errors

When a client sends malformed XML, catch the exception and send a better error message. Currently throws a full stack trace.

IRC/Jabber notifications should include some preview of the content

Rather than just sending "x linked to y", the IRC notification should include some info from the parsed microformats of the source URL if possible.

Some example sentences:

  • "{author} liked {target url} ({post url})"
  • "{author} reposted {target url} ({post url})"
  • "{author} liked a tweet that linked to {target url}" (might be difficult to tell)

The post url shown should be the post URL indicated by the microformats rather than the source URL, so that bridgy proxy urls don't appear.

feature request: allow some safe html in comment content, e.g. links

right now it looks like all HTML tags in the comment h-entry are stripped. :/

here's an example: http://snarfed.org/replies/google-calendar-and-email-addresses

the e-content is:

<p>agreed, google calendar was <a class="u-in-reply-to" href="http://tantek.com/2013/351/t1/no-gmail-event-google-calendar-sucks-identity">bad at this</a> for a long time.</p>

<p>they did improve it a bit a while back, though. if you haven’t already, and you care enough :P, add that email address to your google account, <a href="https://support.google.com/calendar/answer/74783?hl=en">then try this</a>.</p>

and curl 'http://webmention.io/api/mentions?target=http://tantek.com/2013/351/t1/no-gmail-event-google-calendar-sucks-identity' shows this:

{
   "links" : [
      {
         "source" : "http://snarfed.org/replies/google-calendar-and-email-addresses",
         "verified_date" : "2013-12-17T23:02:14-08:00",
         "data" : {
            "published" : "2013-12-17T21:16:41-08:00",
            "content" : "agreed, google calendar was bad at this for a long time.\n\nthey did improve it a bit a while back, though. if you haven’t already, and you care enough :P, add that email address to your google account, then try this.",
            "name" : "google calendar and email addresses",
            "url" : "http://snarfed.org/replies/google-calendar-and-email-addresses",
            "published_ts" : 1387343801
         },
         "id" : 3266,
         "verified" : true
      }
   ]
}

Cluster mention notifications

When multiple webmentions are received in short succession for the same target, it should result in a single notification sent to IRC rather than one for each target.

Something like "... commented on a post that linked to _____, _____ and ____"

target urls with fragments (or fragmentions?) aren't supported?

from the log here:

I Source: Tantek Çelik (Twitter) t, http://brid-gy.appspot.com/twitter/t
I Created by this poll: http://brid-gy.appspot.com/log?start_time=1406399788&;key=aglzfmJyaWQtZ3lyDgsSB1R3aXR0ZXIiAXQM
I Starting Response repost tag:twitter.com,2013:493100366989246464 https://twitter.com/kevinmarks/status/493100366989246464
I Webmention from https://brid-gy.appspot.com/repost/twitter/t/493082034391093248/493100366989246464 to http://tantek.com/2011/168/b1/practices-good-open-web-standards-development##use+an+open+wiki
I Using cached webmention endpoint for tantek.com: http://webmention.io/tantek.com/webmention
I Sending...
I Starting new HTTP connection (1): webmention.io
D "POST /tantek.com/webmention HTTP/1.1" 400 None
W Error sending to endpoint: {u'error_description': u'The target URI does not exist', 'code': 'RECEIVER_ERROR', 'request': u'POST http://webmention.io/tantek.com/webmention (with source=https://brid-gy.appspot.com/repost/twitter/t/493082034391093248/493100366989246464, target=http://tantek.com/2011/168/b1/practices-good-open-web-standards-development##use+an+open+wiki)', 'http_status': 400, u'error': u'target_not_found'}
W Propagate task failed

the source page does indeed link to the target:

<p class="u-mention"><a href="http://tantek.com/2011/168/b1/practices-good-open-web-standards-development##use+an+open+wiki"></a></p>

author object missing type:card

The author property drops the specification of type:card. This causes problems as any untyped objects are to be content-type / value containers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.