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

mass url shortener?

Discussion in 'Social Networking Sites' started by txholdem, Feb 16, 2017.

  1. txholdem

    txholdem Elite Member

    Joined:
    Feb 23, 2009
    Messages:
    1,712
    Likes Received:
    209
    is there a url shortener that can be used for mass shortening?

    i remember that bit.ly has a limit. goo.gl gives captcha. i tried wordpress plugin pretty link, but it appears to use a lot of cpu and shut down my server.

    is there something that i can use to do mass shortening?
     
  2. DaPromo

    DaPromo Junior Member

    Joined:
    Jan 10, 2017
    Messages:
    167
    Likes Received:
    60
    Occupation:
    подковать блоху
    Location:
    Мать Земля
    Have you tried tinyurl?
     
    • Thanks Thanks x 1
  3. Shibbi90

    Shibbi90 Regular Member

    Joined:
    Mar 3, 2011
    Messages:
    384
    Likes Received:
    104
    Gender:
    Male
    Location:
    Norway
    host your own url shortener with yourl.com. You can install a plugin for mass url shortening :)
     
    • Thanks Thanks x 1
  4. DaPromo

    DaPromo Junior Member

    Joined:
    Jan 10, 2017
    Messages:
    167
    Likes Received:
    60
    Occupation:
    подковать блоху
    Location:
    Мать Земля
    Here you go made a small and quick shorturl javascript to run in your browser console to automatically generate new urls, however many you like. I can also add an automatic loop if you want. Right now you have to manually press enter for each short url you want.

    Instructions:
    Go to *********** (without www because of CORS)
    Then press F12 to open console
    Paste code in console and run

    Change "yourdomain.com" for the domain you want to shorten
    Change under "new image().src" the "domain.com" for your domain where you saved the "save.php" file
    Code:
    var e = "http://www.yourdomain.com" + "?" + Math.floor(Math.random() * 100000);;
       
       
    var httpx = new XMLHttpRequest;
            httpx.open("GET", "http://***********/api-create.php?url=" + e, false);
            httpx.onreadystatechange = function() {
                new Image().src = 'http://www.domain.com/save.php?link=' + httpx.responseText;
            };
    httpx.send()
    
    
    Add this code as save.php
    Code:
    <?php
    $link = $_GET['link'];
    $link .= "\r\n";
    $saveto =  'links.txt';
    file_put_contents($saveto, $link, FILE_APPEND);
    ?>
    
    I have not tested this but I think it will works 100%. Tell me if not working ok
     
    • Thanks Thanks x 1
  5. txholdem

    txholdem Elite Member

    Joined:
    Feb 23, 2009
    Messages:
    1,712
    Likes Received:
    209
    sorry, what is *******? is that your server?
     
  6. DaPromo

    DaPromo Junior Member

    Joined:
    Jan 10, 2017
    Messages:
    167
    Likes Received:
    60
    Occupation:
    подковать блоху
    Location:
    Мать Земля
    tinyurl. filtered for some reason
     
    • Thanks Thanks x 1
  7. txholdem

    txholdem Elite Member

    Joined:
    Feb 23, 2009
    Messages:
    1,712
    Likes Received:
    209
    @DaPromo:
    "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience."

    no links.txt generated? (should be in my domain.com right?)
     
  8. DaPromo

    DaPromo Junior Member

    Joined:
    Jan 10, 2017
    Messages:
    167
    Likes Received:
    60
    Occupation:
    подковать блоху
    Location:
    Мать Земля
    Hm ok let me actually test this. WIll update here soon

    Edit:
    made some minor mistakes. Here is working console code:

    Code:
    var e = "http://www.yourdomain.com" + "?" + Math.floor(Math.random() * 100000);;
     
    
    var httpx = new XMLHttpRequest;
            httpx.onload = function() {
                new Image().src = 'http://www.domain.com/save.php?link=' + httpx.responseText;
            };
    httpx.open("GET", "http://tinyurl/api-create.php?url=" + e, true);
    httpx.send()
    
     
    Last edited: Feb 17, 2017
  9. txholdem

    txholdem Elite Member

    Joined:
    Feb 23, 2009
    Messages:
    1,712
    Likes Received:
    209
    @DaPromo:

    isn't it supposed to generate a links.txt under my domain.com?
    i don't see it.
     
  10. DaPromo

    DaPromo Junior Member

    Joined:
    Jan 10, 2017
    Messages:
    167
    Likes Received:
    60
    Occupation:
    подковать блоху
    Location:
    Мать Земля
    You may need to chmod the files. For a start chmod save.php to 777 or if it fails because of security settings, chmod it to 755. Also create links.txt file it this file was not created by itself.
    Post here if it still not working!
     
  11. txholdem

    txholdem Elite Member

    Joined:
    Feb 23, 2009
    Messages:
    1,712
    Likes Received:
    209
    ok. here's what i get.
    links.txt has to be 777.
    to get rid of the excessive line breaks, remove the line $link .= "\r\n";

    problem though: the shortened url directs to original url/?32454 (5-digit random number)?
     
  12. DaPromo

    DaPromo Junior Member

    Joined:
    Jan 10, 2017
    Messages:
    167
    Likes Received:
    60
    Occupation:
    подковать блоху
    Location:
    Мать Земля
    Yes because tinyurl doesn't allow same links to be new url. So you cannot add more than 1 unique tinyurl for http://yourdomain.com but if we use random query after like http://yourdomain.com?123123 it will think it's another page and give us a new url. Let me know if this confuses you and we can find a smart solution for this!
     
  13. derjrjr

    derjrjr Junior Member

    Joined:
    Nov 1, 2015
    Messages:
    190
    Likes Received:
    20
    Occupation:
    SMS Verification Panel
    Location:
    ⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩
    Home Page:
    I have a method that works really well, PM me
     
  14. txholdem

    txholdem Elite Member

    Joined:
    Feb 23, 2009
    Messages:
    1,712
    Likes Received:
    209
    that extra random string might cause affiliate links, e.g., amazon links to not work properly.
     
  15. txholdem

    txholdem Elite Member

    Joined:
    Feb 23, 2009
    Messages:
    1,712
    Likes Received:
    209
    @DaPromo - you have a better solution without the random digits?
     
  16. HoNeYBiRD

    HoNeYBiRD Jr. VIP Jr. VIP

    Joined:
    May 1, 2009
    Messages:
    6,956
    Likes Received:
    7,985
    Gender:
    Male
    Occupation:
    Geographer, Tourism Manager
    Location:
    Ghosted
    If you want to make multiple unique shortened urls of a single long url and you don't want to use the "?randomstring" trick to make your long url unique, you need an url shortener, which supports creating multiple unique shortened urls of a single long url . As DaPromo suggested it above, tinyurl doesn't support this, most url shorteners don't support this. I'm not sure about your purpose, but if you use a too obscure url shortener or if you use your own (e.g. what you made with yourls), it can get blocked easily, because of the root domain being used by very few or only by you, if it's your own shortener. So try to look for this among the more well known shorteners, then figure out a way to mass shorten.

    For instance ow.ly supports this, but there's a captcha before each creation. There's an API, but it's only available with the Enterprise plan of Hootsuite, which doesn't have a price tag, but the plan below it costs $100/month.

    T i n y . c c supports this too, there is no captcha, so i guess you can automate the process with iMacros. They also have paid API access, starting from $9/month with a 14 day free trial.
     
  17. txholdem

    txholdem Elite Member

    Joined:
    Feb 23, 2009
    Messages:
    1,712
    Likes Received:
    209
    thanks for the info.
    btw, goo.gl has no problem, but captcha will come up if used too much. twitter has no problem of me using my own shortener at all, except that it uses too much server resources.
    the question is i dont know if adding a random string will be a problem with amazon links.
     
  18. HoNeYBiRD

    HoNeYBiRD Jr. VIP Jr. VIP

    Joined:
    May 1, 2009
    Messages:
    6,956
    Likes Received:
    7,985
    Gender:
    Male
    Occupation:
    Geographer, Tourism Manager
    Location:
    Ghosted
    You mentioned above a WP site and Pretty Link, so i assume (maybe falsely lol), that you promote your site and not direct Amazon urls. In that case how would that random string trick be able to affect the Amazon urls? I guess you worry about being credited for the sales.

    Another thing: i don't promote Amazon, but i know that they're pretty anal about link cloaking/shortening:

    "(v) You will not cloak, hide, spoof, or otherwise obscure the URL of your Site containing Special Links (including by use of Redirecting Links) or the user agent of the application in which Content is displayed or used such that we cannot reasonably determine the site or application from which a customer clicks through such Special Link to the Amazon Site.

    (w) You will not use a link shortening service in a manner that makes it unclear that you are linking to an Amazon Site."

    Whatever the fuck this last one (w) supposed to mean. Unless customizing, how are you supposed to make the destination of a shortened url clear in itself? If it's in context (and you're not purposely misleading), it's clear. If not, then not. :)

    On the other hand Twitter can follow redirects, so generating unique shortened urls for the same long url might not do a thing, because they're only visually different, the destination stays the same. The random string trick changes the destination though.
     
  19. txholdem

    txholdem Elite Member

    Joined:
    Feb 23, 2009
    Messages:
    1,712
    Likes Received:
    209
    using my wordpress pretty link in fact might break the amazon rule you cited because they cannot determine where the click was generated, not to mention server resource consumption. so i am not taking that route.

    yes, my concern is if adding a random string at the end of amazon url will make the link invalid. i am waiting for my test result. breaking amazon rule is not a concern in this case.
     
  20. thebigweb

    thebigweb Regular Member

    Joined:
    Nov 19, 2007
    Messages:
    356
    Likes Received:
    135
    Location:
    The Moon
    Home Page:
    301 Nuke might fit your needs, It also creates tiers.