[Trick] GM_Script "Retrieve" the feed address in the feed

Pitching/feedback/suggestions: My salted fish heart    Aigeng - @ wdssmq

The shortcut keys of the virtual desktop are still hard to remember

Related article: 20210227485

Todo: How to quote your own article in Hexo's blog | Morningstar's personal blog ←←

Also, the mdlint plug-in requires a space between English and Chinese, so it is also slightly tangled;

Requirements description

When viewing subscribed items in Feedly, the address bar displays as follows:

https://feedly.com/i/subscription/feed%2Fhttps%3A%2F%2Ffeed.wdssmq.com

https://feedly.com/i/subscription/feed%2Fhttps%3A%2F%2Fwww.wdssmq.com%2Ffeed.php

The "feed address" part is transcoded, although it can be directly recognized by human flesh for shorter addresses. In addition, in the " ··· More settings You can also see the echo of the source address..

make complaints:
[Sure enough, from the beginning of the blog suggestion, the star people who "don't want to match pictures" didn't improve much even after they switched to "Markdown+free map bed";

[Feedly echo was added halfway after a long time..

However, for some problematic feeds, the following information will be prompted and you will not be given the option to view the source address:

 <div id="feedlyPageFX" class="container centered"> <h2 class="Heading Heading--h2"> Feed not found <div class="sub">Wrong feed URL or dead feed</div> </h2> </div>

As a "GM_Script" maniac, he really decided to solve this problem by himself and write an article;

Code implementation and explanation

  • In this way, the frequency of "retrieving" the feed is slightly lower, so it is better to set it to click trigger;
  • Because Feedly uses the front-end rendering mechanism, it indicates that the corresponding html does not exist in the Source Code View, that is, it belongs to the "future element", so the "listening event" needs to be set on the existing element node that will contain the "future element". In this case body#box
 <body id="box" class="home"> ………… </body>
  • Listen to events: click, press, and pop up. All are available here. The code uses mouseup
  • When an element with an error prompt is clicked, the following operations are performed:
    • Get the part of the feed from the current address;
    • decode;
    • Output to page;
  • ↑ The first two steps can be interchanged;
  • Used when outputting to page Element.insertAdjacentHTML - Web API interface reference | MDN , similar to the .append() method;
  • The specific output element should also be analyzed and tried, and then the existing style class should be used as appropriate;
 (function () { "use strict"; function $n(e) { return document.querySelector(e); } function $na(e) { return document.querySelectorAll(e); } function addEvent(element, evnt, funct) { return element.addEventListener(evnt, funct, false); } //Get back the feed address //Bind listening events to div # box addEvent($n("#box"), "mouseup", function (event) { //Output the element that triggers the event console.log(event.target); //Determine whether to execute the corresponding operation according to the content const elText = event.target.innerHTML; if ( // elText.indexOf("Feed not found") > -1 || ElText. indexOf ("Wrong feed URL")>- 1//Ensure that both lines in the prompt message can be triggered ) { //Internal output again to confirm that the judgment condition is correct console.log(event.target); //Get the decoded feed address const curUrl = ((url) => { return url.replace(" https://feedly.com/i/subscription/feed/ ", ""); })(decodeURIComponent(location.href)); //Output to page $n("#feedlyPageFX h2").insertAdjacentHTML( "beforeend", `<div class="sub">${curUrl}</div>` ); } }); })();

end

For the address of the complete script of self used Feedly, see:

 // ---------------------------- // @raw     https://github.com/wdssmq/userscript/tree/master/feedly // @raw     https://greasyfork.org/zh-CN/scripts/381793 // ---------------------------- // @link    https://afdian.net/ @wdssmq // @link    https://github.com/wdssmq/userscript // @link    https://greasyfork.org/zh-CN/users/6865-wdssmq // ----------------------------

Another related article: 20100222433


 Love generating electricity

Title:《 [Trick] GM_Script "Retrieve" the feed address in the feed 》Author: Ice sinking and floating water
Original link: https://www.wdssmq.com/post/20210305305.html
Unless otherwise specified, it is original. Please specify if it is reproduced.

Share to WeChat

Scan QR code

You can view or share with your friends on WeChat.

Related articles

I seem to have seen this, and I marvel at these cheap labor
reply
 Amen Amen Issued on 2010-09-20 10:47:40
#cmt2339
strong
————
Return visit
reply
 clyee clyee Issued on 2010-09-19 23:19:45
#cmt2338
Faster than the machine
reply
 Awkward Awkward Issued on September 19, 2010 16:12:32
#cmt2337
There should be child labor in it! In fact, the bank staff are also quite awesome.
reply
There must be no such ox man.. At least not in this factory.. This should be a portrayal of Chinese factories..
----------
Jokes don't need classification, only full text subscription
reply
 Weiqi life Weiqi life Issued on September 18, 2010 at 18:48:18
#cmt2335
It's too tough. I worked as a packager in a pharmaceutical factory. My hands hurt
reply
 visitor visitor Issued on 2010-09-18 16:27:04
#cmt2334
The Mid Autumn Festival will be held in 3 days. I wish you and your family a happy Mid Autumn Festival!
reply
 Long bow small k Long bow small k Issued on September 18th, 2010 15:52:04
#cmt2333
I..................... x
Shocked
reply
This speed. Is there no mechanized equipment to install it..
reply
Comment:

◎ Welcome to participate in the discussion. Please express your views and exchange your views here.

Site classification

search

Old articles of this week

Wdssmq/blog astro: a static blog based on Astro;

Essentially, when faced with a code problem, we need another person who is willing to invest energy in your problem and has the corresponding technical knowledge..

Next, it seems that the replacement of Resilio Sync with Synything is also a slightly larger project.. Orz

GoodSync gave away a one-year license last year, and then it actually used it; I was thinking about changing Synything when it was due, but the last few days I gave a reminder that I spent ¥ 381 to renew Orz for three years. There are still some differences between their positioning and posture.. Earlier, Resilio Sync and BCompare were used, but the former occupied too much memory, and the latter was not automatically synchronized..

2024, let's back up the Duet archive..

... An unknown niche style library+inline style hybrid writing is indeed a bit groovy, but it is absolutely positive that "learning has begun" and can continue..

After reading a lot of questions in the post bar, there is an illusion that many people have registered a post bar specifically to ask a question, and the question itself may or may not be answered effectively (related to the point of question and the specific posture). However, in any case, after that, there will be no more than after cancelling the account, as if you never have to learn the corresponding things..

Devil Doll

-They are studying whether you are a real adult or a child pretending to be an adult

-I've studied it for a long time myself

In Lego DC, (basically the Batman family, the youngest one will become the same no matter who feels the design --

So, just like Sister Xianglin, I need to "sign in" my emotional feelings every day, but there is no need for me to sign in like this

Powergeneration supporter

Latest comments

Friendly Links

  •  Subscribe to RSS 2.0 news aggregation on this site
Call Eastwar