1. If you're receiving a message that you are banned from the Current Events or Politics forums, it's not you specifically: those forums have been hidden for all users. For more info, see here.
    Dismiss Notice

embed wikipedia page - possible?

Discussion in 'Programming & Software Development' started by vladtepes, May 13, 2019.

  1. vladtepes

    vladtepes Member

    Joined:
    Sep 30, 2015
    Messages:
    2,914
    Location:
    Brisbane, Qld
    I'm creating a forum and rather than simply link a Wikipedia page I'd like to embed it on the forum for easy reading. Ideally dynamically so when its updated on Wikipedia it also updates on the site; but even a 'snapshot' embed would be fine.

    Firstly does anyone know if this is even possible?

    And if so - how would I go about it please? (Hopefully it can be done with html / php code)
     
  2. neRok

    neRok Member

    Joined:
    Aug 19, 2006
    Messages:
    4,072
    Location:
    Perth NOR
    You can use html <iframe> to embed another webpage, but I would recommend against it. It's unnecessary usage to automatically force users to access/download that wiki page. It wastes battery, wastes data, wastes energy, etc.

    If you want to capture the text of a wiki page at the time someone quotes the wiki page, you can do that server side. This is basic data scraping. You could take an actual screenshot via some automatic methods (I'm not sure what), or you could use the server to read the wikipage and extract all the text, or just the intro. You could then save that text in the database. This would increase the server workload, data storage, and data transfer requirements. So not ideal.

    You could leverage the waybackmachine to archive the wikipage at the exact date and time that you want, if that is important.

    Probably the best idea is to use javascript on the client device. The javascript could be run on demand by the user (clicking a button, or hovering over soemthing), and then the clients device would access and display the wikipage intro or text where you want.

    See https://stackoverflow.com/questions...kipedia-api-just-for-retrieve-content-summary
     
    vladtepes likes this.
  3. OP
    OP
    vladtepes

    vladtepes Member

    Joined:
    Sep 30, 2015
    Messages:
    2,914
    Location:
    Brisbane, Qld

Share This Page

Advertisement: