I’m thinking of looking at the Lemmy api and that’s best done when you have some actual problem to solve!

So, is there any bot that you’d like to see?

  • XpeeN@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    How to make a site handler:

    • Go to your favorite news site (for example: euronews.com)
    • Go to a random article
    • Go to the blank space inside of the actual article (Not the summary that’s usually on top)
    • Right click on that spot and go to inspect

    In our example:

    • Then, look at the div HTML element it selected for you, and try to go up to the Parent div element as long as when you select it, only the body of the article get mark. In our example, when I did the inspect step, I got this div element marked:

    But, as I went up the tree like the last step said, I found this div:

    You might think to go even upper like this:

    But as you can see, the browser highlighted parts that aren’t the body of the article itself. So…don’t.


    Now that we got the correct div, we’ll fill the siteHandler template like this

    Then,

    • Save that template as SiteHandler.php (in our example, EuronewsSiteHandler.php )
    • Send PR to the Official AutoTldr repo with the file you just created.
    • DONE

    Edit it as you wish, or let me know if you need me to do so. No need for credit obviously, just helping improve this amazing tool is enough :)

    Note: I had to use that codefile website because something went wrong with the code markdown, but I guess you can skip it once you put it on github.

    • Rikudou_Sage@lemmings.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      Thank you very much! I’ve saved the comment and when I have time I’ll include it in the repository’s readme.

      • XpeeN@sopuli.xyz
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        1 year ago

        NP, but I’d advise you to save it somewhere else as a whole as I don’t know for how long that code sharing website host the templates. Although you can easily rewrite this part.