#include <string>
#include <algorithm>
#include <sstream>
#include <vector>
#include <iterator>
#include <iostream>
using namespace std;
string stringCleaner(const string &str)
{
    istringstream tempStr(str);
    ostringstream cleanLine;
    unique_copy(istream_iterator<string>(tempStr),
                istream_iterator<string>(),
                ostream_iterator<string>(cleanLine, "\n"));
    return cleanLine.str();
}

int main()
{
    std::cout << stringCleaner("http://w...content-available-to-author-only...a.com\nhttp://w...content-available-to-author-only...b.com\n"
                               "http://w...content-available-to-author-only...b.com\nhttp://w...content-available-to-author-only...c.com\n"
                               "http://w...content-available-to-author-only...d.com\nhttp://w...content-available-to-author-only...d.com\n"
                               "http://w...content-available-to-author-only...d.com\nhttp://w...content-available-to-author-only...d.com\n"
                               "http://w...content-available-to-author-only...e.com");
}
