Vivaldi

  • Browser
  • Mail
  • News
  • Community
  • About

Navigation

    • Browser
    • Mail
    • News
    • Community
    • About
    • Register
    • Login
    • Search
    HomeBlogsForumHelpThemes
    • Home
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Desktop
    3. Customizations & Extensions
    4. Modifications
    5. OPML Export

    OPML Export

    Modifications
    javascript rss export
    7
    14
    1094
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • LonM
      LonM Moderator last edited by

      Problem
      I want to make an OPML file with all my vivaldi feeds in it

      Solution
      Paste the following code into the browser console.

      vivaldi.prefs.get("vivaldi.rss.settings", feeds => {
          function html(str){return str.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');}
          let opml = feeds.reduce((acc, feed) => {
              return acc + `\n<outline type="rss" text="${html(feed.title)}" title="${html(feed.title)}" xmlUrl="${html(feed.url)}"/>`;
          }, `<?xml version="1.0" encoding="utf-8"?><opml version="1.0"><head><title>Feeds exported from Vivaldi</title></head><body>`);
          opml += `\n</body></opml>`;
          const filename = "exportedfeeds_"+new Date().toDateString().replace(/\s/g,"-")+".opml";
          const textfile = new File([opml], filename, {type: "text/xml"});
          const dl = document.createElement("a");
          dl.download = filename;
          dl.setAttribute("href", window.URL.createObjectURL(textfile));
          dl.click();
      });
      

      Notes

      • Don't install it as a javascript mod, or it'll run every time you open a new window. Just paste it into the console whenever you need it.
      • OPML only contains the URLs, not actual feed items.
      • The file created has the date in it. If your language has strange characters, that might not work, edit the filename variable to change it

      πŸ’» Windows 10 64-bit Sopranos Builds β€’ en-GB β€’ πŸ—³ vote for features β€’ πŸ•΅οΈβ€β™€οΈ Code of Conduct β€’ 🐞 Report bugs

      luetage fred8615 2 Replies Last reply Reply Quote 12
      • luetage
        luetage @LonM last edited by luetage

        @LonM Thanks, export works. Could come in handy.
        @Zalex108 You might wanna note that down too.

        github β—Š vfm

        1 Reply Last reply Reply Quote 3
        • jumpsq
          jumpsq last edited by jumpsq

          It has worked for me before, but fails with the most recent snapshot (returning undefined). Is this due to internal changes or do I miss something?

          // Ok, I missed something :))
          See next post.

          arch linux. swaywm. vivaldi-snapshot. m3.

          luetage 1 Reply Last reply Reply Quote 0
          • luetage
            luetage @jumpsq last edited by

            @jumpsq Check your download folder.

            github β—Š vfm

            1 Reply Last reply Reply Quote 1
            • fred8615
              fred8615 @LonM last edited by

              @LonM I can't this to work on 5.3. I get the following error:

              VM167:1 Uncaught ReferenceError: vivaldi is not defined
              at <anonymous>:1:1

              I tried changing the filename parameter, and then it gives me this:

              Uncaught SyntaxError: missing ) after argument list

              Using Windows 10. Everything 64 bit and the latest version.

              Frederick J. Barnett
              "Someone's got to take the responsibility if the job's going to get done!! Do you think that's easy?!" Gregory Peck - The Guns Of Navarone

              nomadic luetage 2 Replies Last reply Reply Quote 0
              • nomadic
                nomadic @fred8615 last edited by nomadic

                @fred8615 said in OPML Export:

                VM167:1 Uncaught ReferenceError: vivaldi is not defined
                at <anonymous>:1:1

                That error could show up if you are running it in the devtools console for a webpage rather than the browser interface's.

                See: Inspecting the Vivaldi UI with DevTools


                I tried changing the filename parameter, and then it gives me this:
                Uncaught SyntaxError: missing ) after argument list

                What did you change it to?

                fred8615 1 Reply Last reply Reply Quote 1
                • luetage
                  luetage @fred8615 last edited by

                  @fred8615 I just tested it again, the script works. I’d say nomadic guessed right.

                  github β—Š vfm

                  1 Reply Last reply Reply Quote 1
                  • fred8615
                    fred8615 @nomadic last edited by fred8615

                    @nomadic I got it! It was because I was trying it while here in the forum. Opened a new window and the browser interface page, and it worked.

                    The filename I was trying was "Vivaldi feeds", which I just discovered I was putting in the wrong place anyway.

                    Frederick J. Barnett
                    "Someone's got to take the responsibility if the job's going to get done!! Do you think that's easy?!" Gregory Peck - The Guns Of Navarone

                    1 Reply Last reply Reply Quote 0
                    • ArchiTechOffi
                      ArchiTechOffi last edited by ArchiTechOffi

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • ArchiTechOffi
                        ArchiTechOffi last edited by

                        Hi @LonM, I have two questions for you.
                        On one hand, can't use this code. I think that is becouse I have Vivaldi on Spanish language so I don't know how modify the variable of filename.
                        And on the other hand, on your answer to @fred8615 you said that the error of anonym is for exect it on console devtools, but...if we don't exect on this console, where we must do it? 😧 I saw the link that you said but I have this doubt.😒

                        LonM 1 Reply Last reply Reply Quote 0
                        • LonM
                          LonM Moderator @ArchiTechOffi last edited by

                          @ArchiTechOffi The filename should work even in other languages. I don't think Spanish would be too different to English.

                          You use the browser dev tools. You can access these using the instructions given here: https://forum.vivaldi.net/topic/16684/inspecting-the-vivaldi-ui-with-devtools?page=1

                          (I don't know spanish, so I can't translate unfortunately)

                          πŸ’» Windows 10 64-bit Sopranos Builds β€’ en-GB β€’ πŸ—³ vote for features β€’ πŸ•΅οΈβ€β™€οΈ Code of Conduct β€’ 🐞 Report bugs

                          1 Reply Last reply Reply Quote 0
                          • thinkeranddoer
                            thinkeranddoer last edited by

                            Hi I'm really trying to do this but I've never used a web dev console before. I get this error and reading through comments its unclear what I must change to avoid the error!

                            2023-02-13 12.45.37.jpg

                            1 Reply Last reply Reply Quote 0
                            • luetage
                              luetage last edited by luetage

                              @thinkeranddoer You need to use the developer tools console of the user interface. Follow links for »inspecting Vivaldi UI with devtools« above. When you do that and it works you will get an »undefined« in console, but the file will have downloaded. Perhaps one day @LonM will find it in him to write a closing console info with a success message 😏

                              github β—Š vfm

                              LonM 1 Reply Last reply Reply Quote 1
                              • LonM
                                LonM Moderator @luetage last edited by LonM

                                @luetage Any exit message that isn't an error is a success in my view. angel

                                πŸ’» Windows 10 64-bit Sopranos Builds β€’ en-GB β€’ πŸ—³ vote for features β€’ πŸ•΅οΈβ€β™€οΈ Code of Conduct β€’ 🐞 Report bugs

                                1 Reply Last reply Reply Quote 1
                                Loading More Posts
                                • Oldest to Newest
                                • Newest to Oldest
                                • Most Votes
                                • Reply as topic
                                Log in to reply
                                • 1 / 1
                                • First post
                                  Last post

                                Looks like your connection to Vivaldi Forum was lost, please wait while we try to reconnect.

                                Copyright © Vivaldi Technologies™ β€” All rights reserved. Privacy Policy | Code of conduct | Terms of use | Vivaldi Status