[C#] ADF.LY Mass Link Generator
This is a small app which loads urls from a text file automatically, then when clicked to convert it will contact the server using api and convert all urls which were automatically loaded into the listbox. Once converted it will put new links into the 2nd listbox after that clicking save will create a new text file containing new adf.ly links.
You will need ( I will just post a screenshot instead ):
Code:
License:
Free to use as Open-Source, feel free to use commerically as long as their are credits as "Help from [email protected]".
Also. If you know other websites like adf.ly and adfoc.us etc sites like that, which have the api url you can replace the url inside the code like the example above and change it to the new site
The reason I made this was when I use to believe that adf.ly paid a lot I wanted to convert links for every upload I made which had parts of up to 20 files and converted to adf.ly links but I didn't get paid much so I gave up. The code is some what commented so it should be okay to understand if not, dont use it. and I wont do any support unless money is involved
ENJOY!
This is a small app which loads urls from a text file automatically, then when clicked to convert it will contact the server using api and convert all urls which were automatically loaded into the listbox. Once converted it will put new links into the 2nd listbox after that clicking save will create a new text file containing new adf.ly links.
You will need ( I will just post a screenshot instead ):
Code:
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;
namespace URLShrinkPlatinum
{
public partial class Form1 : Form
{
string convert = "Status: Conversion Complete!";
string save = "Status: Save Complete!";
string apploaded = "Status: App Loaded!";
string copyrights = " - Developed by [email protected]";
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// Declare, and set WebClient Vars, txtStatus.text
txtStatus.Enabled = false;
txtStatus.Text = apploaded + copyrights;
// AutoLoad raw urls..
this.lbRaw.Items.Clear();
try
{
StreamReader LoadURL = new StreamReader(Convert.ToString("rawURL.txt"));
while (LoadURL.Peek() >= 0)
lbRaw.Items.Add(Convert.ToString(LoadURL.ReadLine()));
}
catch (Exception ex)
{
MessageBox.Show(Convert.ToString(ex.Message));
return;
}
}
private void btnExit_Click(object sender, EventArgs e)
{
// easy said, easy done..
this.Close();
}
private void btnConvert_Click(object sender, EventArgs e)
{
// Disable this.button, so users know its converting..if there smart..
this.btnConvert.Enabled = false;
// Loop for each item in listbox and convert..
for (int i = 0; i < this.lbRaw.Items.Count; i++)
{
// get count of items
this.lbRaw.SetSelected(i, false);
// webclient declaration
System.Net.WebClient newClient = new System.Net.WebClient();
// string to hold url retreieved.. <wrong spellin lawl..
string apikey = "901f3bb31fd2638fd14ee0a6d216263a"; // replace with your api key found in adf.ly api docs
string uid = "511563"; //replace with your user id found in adf.ly api docs
string newURL = newClient.DownloadString("http://api.adf.ly/api.php?key=" + apikey + "&uid=" + uid + "&advert_type=int&domain=adf.ly&url=" + this.lbRaw.Items[i]);
// add new urls to 2nd listbox..
this.lbNew.Items.Add(newURL.ToString());
}
// re-enable button, convert
this.btnConvert.Enabled = true;
// set status update..
txtStatus.Text = "Status: Converted! " + copyrights;
}
private void btnSave_Click(object sender, EventArgs e)
{
// save to file..
StreamWriter Write;
try
{
Write = new StreamWriter("newURL.txt");
for (int a = 0; a < this.lbNew.Items.Count; a++)
{
Write.WriteLine(Convert.ToString(lbNew.Items[a]));
}
Write.Close();
}
catch (Exception ex)
{
MessageBox.Show(Convert.ToString(ex.Message));
return;
}
txtStatus.Text = "Status: Saved! " + copyrights;
}
}
}
License:
Free to use as Open-Source, feel free to use commerically as long as their are credits as "Help from [email protected]".
Also. If you know other websites like adf.ly and adfoc.us etc sites like that, which have the api url you can replace the url inside the code like the example above and change it to the new site
The reason I made this was when I use to believe that adf.ly paid a lot I wanted to convert links for every upload I made which had parts of up to 20 files and converted to adf.ly links but I didn't get paid much so I gave up. The code is some what commented so it should be okay to understand if not, dont use it. and I wont do any support unless money is involved
ENJOY!