1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Find and record every outbound link to a particular domain

Discussion in 'XenForo Questions and Support' started by dvsDave, Mar 17, 2014.

  1. dvsDave

    dvsDave Well-Known Member

    So one of the sites that we link to very frequently is re-doing their entire world-wide websites (including continent-specific content) and they've asked me for a list of all outbound links from my site to theirs.

    Their new system is radically different and they are going to hard code 301 redirects to make sure that none of the old links are broken. (their new URL system is too different to do it programatically, that's already been explored and rejected)

    So, my question is, how can I export a list of all outbound links from xenforo to a particular domain? Can I just run a SQL query on a particular table and store the results in a table, filtering for uniqueness? Or is there a better way to get this info?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    The only ways to identify the posts with links are using the built in search or directly querying the xf_post table in the database.
     
  3. dvsDave

    dvsDave Well-Known Member

    thanks for the correct table name. I guess I'll have to figure out the regex for the query. find all links that have domainx.com in it and store the whole link in a table.
     
  4. dvsDave

    dvsDave Well-Known Member

    Still haven't been able to figure out a proper regex for this:

    I want to create a table to save the results.
    Code:
    CREATE TABLE temp_Link_Results
    (
      Links TEXT,
    );
    
    INSERT INTO temp_Link_Results (Links)
    SELECT message
    FROM xf_post
    Where = ____________________________
    I am Trying this regex against the following message to see if I can pull out the full URL with a particular domain as it's root.
    Code:
    /^(?:http(?:s)?:\/\/)?(?:[^\.]+\.)?example\.com(?:/.*)?$/
    But this regex doesn't seem to work against the following example
    Code:
    I am not sure I would purchase the S4 LED Cyc if all I ever wanted to do was light a cyc. It certainly works for the purpose but there are other more cost effective solutions. OTOH, as a facility manager, having a single fixture in inventory that can serve multiple roles is a game changer. It extends the useful life of the fixture. It may also enhance the value of older S4 LED engines on the used market since the pool of likely buyers increases.
    
    FWIW, the[URL='http://www.example.com/product.overview.aspx?Id=22166'] information about the S4 LED II on ETC's website[/URL] is very honest with respect to relative brightness vis-a-vis an incandescent S4 575 and a S4 LED Lustr. Mixing to yellow is downright painful to look upon. The variable colour temperature can make it feel much brighter than the classic Source Four.  [URL='http://example.com']example.com[/url]
     

Share This Page