Github Mirror / telegraf-plugins: 60c66eda




Extract domain details

Extract domain details

Commit 60c66eda.

Authored 2022-12-13T09:28:48.000+00:00 by B Tasker in project Github Mirror / telegraf-plugins

+8 lines -2 lines

Commit Signature

Changes

diff --git a/webmention_io/README.md b/webmention_io/README.md
--- a/webmention_io/README.md
+++ b/webmention_io/README.md
# @@ -12,7 +12,9 @@ Note that because this plugin is collecting mentions rather than aggregate stats
#
# * `type`: The webmention type (`in-reply-to`, `like-of`, `repost-of`, `bookmark-of`, `mention-of`, `rsvp`, `follow-of`)
# * `url`: The URL that the mention references (i.e. the URL on your site)
# +* `domain`: The domain that the mention refers to
# * `author`: The author of the mention
# +* `srcdomain`: The domain that the mention was made on
#
# ----
#
#
diff --git a/webmention_io/webmention_io.py b/webmention_io/webmention_io.py
--- a/webmention_io/webmention_io.py
+++ b/webmention_io/webmention_io.py
# @@ -24,6 +24,7 @@ import datetime as dt
# import requests
#
# from dateutil.parser import parse
# +from urllib.parse import urlparse
#
# # The measurement to write mentions into
# MEASUREMENT = "webmentions"
# @@ -57,10 +58,11 @@ def build_lp(entry):
#
# # Linked URL
# url = entry['wm-target'].split("#")[0]
# -
# + domain = urlparse(url).netloc
# +
# # Where they linked from
# source_url = entry['url'].replace('"', '')
# -
# + source_domain = urlparse(source_url).netloc
#
# # Start putting it all together
# tagset = [
# @@ -68,6 +70,8 @@ def build_lp(entry):
# f'type={wm_type}',
# f'url={url}',
# f'author={author}',
# + f'domain={domain}',
# + f'srcdomain={source_domain}',
# 'influxdb_database=webmentions'
# ]
#
#