snarfed / bridgy

πŸ“£ Connects your web site to social media. Likes, retweets, mentions, cross-posting, and more...
https://brid.gy
Creative Commons Zero v1.0 Universal
718 stars 52 forks source link

Probably is "user-error" but still I need some assistance ✨pleaseπŸ™πŸ» #1094

Closed jalsco closed 2 years ago

jalsco commented 2 years ago

I got lots working already... For example: all the incoming web-mentions and tweets, are being received and displaying nicely on my (static) webpages. Thats all good πŸ‘πŸ» I also got bridgy previewing - and sending out tweets, including images and all the options... So I know all my micro-formating is fairly good.

However some problems:

  1. Problem with curl. curl says unauthorized ? Here's an example:
    {
    "error": "Error: {\"request\":\"\\/1.1\\/statuses\\/update.json\",\"error\":\"Read-only application cannot POST.\"} HTTP Error 401: Unauthorized"
    }
  2. Second problem...
    I cannot get the twitter replies to work (even from bridgy interface) . The tweet will send, but not as a reply. I think must be doing something wrong... I am definitely including the class="u-in-reply-to" href="https://twitter.c .. blah blah etc But have tried 100+ things to fix it, and all failed, so really need some help please...

And here is the microformating:

    <div hidden href="https://brid.gy/publish/twitter"></div>
    ---- etc ----
    <div hidden class="u-bridgy-omit-link"></div>
    <div hidden class="u-in-reply-to" href="<tweet-url>"></div>
    ---- etc ---- 
  </article>
snarfed commented 2 years ago

Glad it's mostly going well! Re # 1, your Twitter auth is in a funny state. Not sure what happened, but try disabling and re-enabling publish on https://brid.gy/twitter/GrokRaving . And re # 2, your u-in-reply-to element needs to be an a, not a div. https://brid.gy/about#reply

jalsco commented 2 years ago

thanks for your fast reply πŸ™πŸ»

  1. ok, I have changed to <a hidden class="u-in-reply-to" href="{{article.tweet_reply}}"></a> so now the reply is working. βœ”
  2. I will tinker with the auth over next few days. Yes, I think I understand what u mean by: is in a funny state.βœ”

As I do not want the URL link in the tweet I am including u-bridgy-omit-link and that is working βœ”

However, I am including my shortened URL in the content of the tweet - by my Jinga2 code. I tried to get brid.gy to automatically use my shortened url - but it won't. That is because of how I self-host (which means a port number is unavoidably in some addresses - which confuses brid.gy) - and I am fine with that.

It is not a problem that brid.gy cannot use my shortened URL.... it just means I need another way (ie posse-post-discovery ) to link back to the url of the tweet on my site, so brid.gy can later find replies to this tweet.. But that makes it get a bit confusing:

image

Seems like I just need 2 more things. πŸ€·πŸ»β€β™‚οΈ

(1) a u-syndication link in the page where I store my tweet.

The doc says u-url and u-syndication. I already have the u-url . Am I supposed to just repeat the contents of the u-url into a u-syndication tag ? like so:

    <div hidden class="u-url" href="{{ SITEURL }}/{{ article.url }}"></div>
    <div hidden class="u-syndication" href="{{ SITEURL }}/{{ article.url }}"></div> 

I suspect I am wrong in that - because - why would both be needed ? ie ( "and" ) .

(2) a "top-level h-entry" in the home page of my blog.

The home page already contains these tags:

<link rel="webmention" href="https://webmention.io/{{ SITEURL-TXT }}/webmention" />
<a class="h-card" rel="me" href="{{ SITEURL }}/"></a>
<a class="u-photo" src="{{ SITEURL }}/logo.png"></a>

So - what is needed ??? top-level h-entry ? pointing to the "top level" ?? What is that ? the home page, i.e itself ? That would be just duplicating the h-card that is already there. What should the top-level h-entry statement look like ?

snarfed commented 2 years ago

Glad replies are working! And Bridgy can definitely do shortened URLs, maybe try that first before going to extra effort for syndication links? https://brid.gy/about#short-link

Otherwise, if you really want to do synd links, for 1: u-syndication links point to the syndicated copy of your post, eg your tweet. Follow the links in the docs for more info, eg https://indieweb.org/u-syndication

And 2: The top-level h-entry was for your individual post pages, which it looks like already have them, eg https://grok.starkraving.asia/2021/11/24/c19cover/ . Your home page https://grok.starkraving.asia/ is missing h-feed and h-entry's though, you'll need those there. https://indieweb.org/h-feed

jalsco commented 2 years ago

Thank you for your reply 😊 Yes, I know that : Bridgy can definitely do shortened URLs

I tried to explain above that I have already tried that - and that it does not work in my case. I gave the reason in my previous comment: , because of how I self-host (which means a port number is unavoidably in some addresses - which confuses brid.gy)

More detail: When Bridgy finds a port number in a URL it seems to just throw it away. If Bridgy kept the port number in the URL then I could let Bridgy handle the shortened URLs... Example:

Example shortened: http(s)://usha.red/qAI It should be mapped to : https://<domain>:8819/qAI

If Bridgy kept the port number (in this case 8819) then it would work for my situation.

So my only option is to go via the other path. And my head is spinning from what you wrote about u-syndication . Maybe I misunderstood it, but u saying it needs the URL of the tweet itself ? That url does not exist until after the tweet is posted... So, before the tweet is posted, it needs to contain a url - that does not exist at that time - so that it can be posted ???

snarfed commented 2 years ago

Sorry I didn't address the port question! Where specifically do you think Bridgy is throwing it away? It looks like it's handling the port ok to me, at least for publishing. eg when I put http://usha.red/qAI into Enter post URL on https://brid.gy/twitter/GrokRaving, I see in the logs that it folllows the redirect(s) and fetches the post ok, including the port, and then correctly returns this error:

image

since your Twitter account links to grok.starkraving.asia, not starkraving.asia.

snarfed commented 2 years ago

And my head is spinning from what you wrote about u-syndication . Maybe I misunderstood it, but u saying it needs the URL of the tweet itself ? That url does not exist until after the tweet is posted... So, before the tweet is posted, it needs to contain a url - that does not exist at that time - so that it can be posted ???

u-syndication links are only needed for backfeed, not publish. You're right though, you wouldn't have the tweet URL when you first publish a post. You'd need to add it in later, after you've created the tweet.

jalsco commented 2 years ago

Sorry I didn't address the port question! Where specifically do you think Bridgy is throwing it away? It looks like it's handling the port ok to me, at least for publishing. eg when I put http://usha.red/qAI into Enter post URL on https://brid.gy/twitter/GrokRaving, I see in the logs that it folllows the redirect(s) and fetches the post ok, including the port, and then correctly returns this error:

image

since your Twitter account links to grok.starkraving.asia, not starkraving.asia

Could not find ... for "starkraving.asia" ... that is the problem. The message should be for "starkraving.asia:8819" . why is the port number dropped from the url ?

From my side.... "starkraving.asia" will never work. I have tried it by adding ""starkraving.asia:8819" and also by adding "http://usha.red/grok" <-- which maps to "starkraving.asia:8819/grok" into twitter profile. Twitter is happy with either of those. But then Bridgy only searches for "starkraving.asia" not for "starkraving.asia:8819".

snarfed commented 2 years ago

Could not find ... for "starkraving.asia" ... that is the problem. The message should be for "starkraving.asia:8819" . why is the port number dropped from the url ?

Because it's not a URL, it's a domain. Bridgy associates your domain(s) with your account, not any specific URLs or ports, and it looks up your account by domain the same way when you try to publish.

snarfed commented 2 years ago

This might work better in chat. Feel free to jump on a talk live! https://indieweb.org/discuss

In the meantime: short links are for publish, u-syndication links are for backfeed. Separate things, they're not interchangeable. You can't use u-syndication as another way to publish with a shortlink. Maybe you want rel-shortlink instead?

jalsco commented 2 years ago

@snarfed Hi again - hopefully this is the last question...

The process on this side is now fully automated. The writers can write once and process once, and all the generation etc happens semi-magically (as far as the writers are aware πŸ˜‰). We've hand-checked, and believe it is as per your advice βœ”

The tweet posts successfully βœ” , BUT we are getting the dreaded "No webmention targets" 😱 on Bridgy dashboard. Just hoping, please, that you can help explain why ? We have labored over the documentation for hours and seems like we already comply with every step. Possibly is something we have misinterpreted.

Example test tweet : Does contain: u-url and u-syndication in its h-entry class.

  1. it was sent by the Bridgy user via the bridgy webpage.
  2. The domain is in Twitter profile.
  3. The domain is showing the Brid.gy page.
  4. In - the page of the Post - on our site we have:
    <article class="h-entry">
      ....
    <div hidden class="u-url" href="<article-URL>"></div>
    <div hidden class="u-syndication" href="<tweet-url-from-twitter"></div>
    <div hidden class="u-bridgy-omit-link"></div>
      ...
    </article>
  5. As the URL of the article is not contained in the Tweet, we are wanting Bridgy to run posse-post-discovery.
  6. So we go through the checklist of steps: "both u-url and u-syndication in the post" βœ” and "one of the following 3" must be in the (post Home page = Link on twitter profile) So we did the 3rd option βœ” i.e: "a <link rel="feed" href="..."> pointing to another page with top-level h-feed or h-entry"
         <link rel="feed" type="text/html" href="<homepage-URL>/hfeed.html">
         <a class="h-card" rel="me" href="<homepage-URL>/"></a>
snarfed commented 2 years ago

The link in that tweet, https://usha.red/YlI , isn't working for me. I tried from multiple locations and clients, all of them time out.

Also, Bridgy only crawls your web site and finds new u-syndication links occasionally, every 6h by default. It will then backfeed any responses it found before then, up to a point, as well as in the future. The crawling Bridgy does (both web sites and silos like Twitter), can be expensive, and Bridgy has >6k accounts, so we limit the frequency.

jalsco commented 2 years ago

not https . it should be : http://usha.red/

jalsco commented 2 years ago

I did press the button to say "crawl it now" (actually multiple times). So I assumed that it had crawled the website If it hasn't then maybe there is no problem . If you have not seen an obvious problem, then that is also a good sign.

snarfed commented 2 years ago

not https . it should be : http://usha.red/YlI

ah, true, sorry!

I see the u-syndication on https://grok.starkraving.asia/2021/12/08/qldpolicevax/ , but it's in a div. It needs to be an a.

I did press the button to say "crawl it now" (actually multiple times).

Hmm, when I looked a bit ago (and then clicked it), it said it hadn't crawled in 6 hours. Were you maybe clicking the Poll now button instead?

(No matter either way though!)

jalsco commented 2 years ago

ok, I changed all instances of u-url and u-syndication to be in <a> not a <div>. That is in 2 places - in the Post page - and also - in the top-level h-feed page (as per link above), and then refreshed the CDN cache.

A bit later today I will also update that "ushared" link so it accepts both http: and https:

Still showing as "No webmention target" 😒

snarfed commented 2 years ago

Great! Your top level https://grok.starkraving.asia/ page still doesn't have any h-entrys though.

Sorry this is so much trouble btw! I know it probably doesn't help, but most people use a server or theme that already supports microformats2 out of the box, so they don't hit most of these problems. You're definitely taking on more challenge by implementing microformats yourself. Totally ok though!

jalsco commented 2 years ago

Don't be sorry - its a learning experience... as long I get there in the end. Thx 4 all yr help too !

The top level page has a link to a page containing h-feed of each one of the articles. and also has its own h-card .. You mean it needs more than that ?

p.s. some problems with dns & nameserver, so that shortening domain ( usha.red ) is actually (temporarily) down at this time

snarfed commented 2 years ago

Each article needs h-entry around it, u-url on the article's permalink, and u-syndication on the tweet link. u-syndication can be on either the home page (eg https://grok.starkraving.asia/ ) or the article page (eg https://grok.starkraving.asia/2021/12/02/qldmand/ ).

jalsco commented 2 years ago

I believe am complying with sentence you just wrote. So, we are still unclear what is missing.

Each article needs h-entry around it βœ” u-url on the article's permalink, and u-syndication on the tweet link. βœ” u-syndication can be either the home page OR article page βœ”

Yes, we satisfy the "or" condition by having the u-syndication on the article page.

And from home page there is link to this (potentially) an entry for every article.

         <div class="h-feed hfeed">
             ....
                <article class="h-entry hentry">
                      <div class="u-url" href="<article-URL>"></div>
                </article>
           </div>
jalsco commented 2 years ago

Do you mean we need u-url and u-synidcation ON BOTH of (1) article page and (2) home page ??

Right now have - u-url and u-synidcation on article page. Right now have - u-url on home page ( via that <link> in your doc)

snarfed commented 2 years ago

Pinged you in chat!

(Short answer, yes, you need at least h-entry and u-url on home page for each article. u-syndication can be on either home page (preferable) or article page.)

jalsco commented 2 years ago

Fully Solved πŸ˜πŸ‘πŸ» - Just a huge thanks from our team to @snarfed for his patience and kind assistance over several days ! I doubt we would have solved it without his help βœ¨πŸ™πŸ»βœ¨

This whole problem case was caused by us choosing to not include the URL link to the article in the tweet text. None of these steps are required when that URL is included. Also - these steps would not be required if we were able to use Bridgy's in-built functionality to handle shortened URLs. There were reasons (brief description above) - relating to our network configuration - that prevented us using that. That would have made it much easier....

The main issues were:

snarfed commented 2 years ago

You're welcome, glad it's working now!