1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Sitemap Generator

Discussion in 'Add-on Requests [Archive]' started by ankurs, Oct 6, 2010.

  1. ankurs

    ankurs Well-Known Member

    Not sure if XF is going to have a sitemap generator in its core, but its one of the most important mod i use in all my forums.

    A basic generator will be fine to begin with, later on can add features like vbseo sitemap generator.
     
  2. RvG

    RvG Active Member

    Agreed. :)
     
  3. Andy.N

    Andy.N Well-Known Member

    this
     
  4. Onimua

    Onimua Well-Known Member

  5. Booth

    Booth Well-Known Member

    This is essential, it'd be great if this could be part of the core software really.
     
    Peggy likes this.
  6. Pyro

    Pyro Member

    Agreed. It'd be awesome to have a sitemap generator in the core, or via modification/addon. :)
     
  7. Stuart Wright

    Stuart Wright Well-Known Member

    +1 very important for SEO.
     
  8. yoghurtfarmer

    yoghurtfarmer Well-Known Member

    Would also help with reindexing for all those who have made the switch already. :)
     
  9. Peggy

    Peggy Well-Known Member

    Absolutely a must-have.
     
  10. Shelley

    Shelley Well-Known Member

    Agreed. A must add-on for xenforo as to air is to us humans. *wheez* *wheez* as thomas the tank engine gasped for air *coughs* sitemap generator.
     
  11. onthefly

    onthefly Active Member

    Yes, must have! :)
     
  12. Jeffin

    Jeffin Well-Known Member

  13. Andy.N

    Andy.N Well-Known Member

    Are we there yet?
     
  14. ArnyVee

    ArnyVee Well-Known Member

    Hopefully soon ;)
     
  15. yoghurtfarmer

    yoghurtfarmer Well-Known Member

    For the time being, I've resorted to using a simple python script to manually generate a list of thread urls since google accepts list text files. I don't recommend it for large boards though unless you were running the script on a local installation.

    For anyone interested, download Python (http://www.python.org/download/).
    Open a new file, copy and paste the code below. Fill out the commented sections (#) and press F5.
    Take the resulting file, upload it to your server and submit that as a sitemap in Google Webmaster Tools.

    Code:
    #!/usr/bin/env python
    
    import urllib2
    
    # path to your xenforo threads directory with the trailing slash
    xenpath = "http://www.yourforum.com/threads/"
    
    # largest thread id on your forum (find the newest thread and write down the id number, don't simply copy number listed in Forum Statistics)
    totalthreads = 529
    
    # path to save the resulting text file
    savepath = "C:/Folder Path/Desired File Name.txt"
    
    filehandle = open(savepath, "w")
    
    print "Working..."
    
    for thread in reversed(range(1, totalthreads+1)):
    
        try:
            link = xenpath+"a.%s/" % thread
            response = urllib2.urlopen(link)
            url = response.geturl()
            filehandle.write(url+"\n")
    
        except urllib2.HTTPError, error:
            if error.code == 404:
                print "Thread #", thread, "is a deleted thread."
            else:
                print "Script has been stopped -", error
                raise SystemExit()
    
    filehandle.close()
    
    print "Completed. Results have been saved to", savepath
    
    Can be used on categories and boards too, just fill xenpath with categories and forums paths respectively.
     
    manik and Ahmed Nawaz like this.
  16. SchmitzIT

    SchmitzIT Well-Known Member

    This should be in the core of XF :)
     

Share This Page