Sueta
AD

AdflyPlugin

4.1

Shorten Links in Chat, and Make Money! by Adf.ly

·Plugin

This plugin was inspired by @twanneke8 and Shortest4Bungee by @Creepers

This plugin can be used on Bukkit servers and Bungee Cord.

Master:
ttttDev:

**I am in no way endorsed by Adf.ly to create this plugin. I did it for fun, and I am sharing it with you guys.**

What is Adf.ly?
Adf.ly is an advertising network based on links that are spread over the Internet. Unlike other ad networks we don’t need even a single pixel of your precious webpage space. We simply take care of your links. Every time a user clicks a link on your website we redirect him to an intermediate page with an ad, after five seconds he’s being taken to the destination URL.
What is AdflyPlugin?
Using AdflyPlugin, we can harness the power of Adf.ly. Whenever a link is put in chat, it is automatically converted to a Adf.ly link, using your API token(set in the config). Whenever someone clicks that link, it will open up a Adf.ly ad, and give you(Server owner) some money!

How do I set it up?

  1. Drag the AdflyPlugin-[version].jar into the "plugins" folder in your server
  2. Add Vault to Bukkit server (if using bukkit version)
  3. Restart your Bungee Cord Proxy or Bukkit server
  4. Create an account on Adf.ly
  5. Go to https://adf.ly/publisher/tools#tools-api, and copy your API token.
  6. Edit the config.yml to your liking, and save it.
  7. Restart your Bungee Cord Proxy or reload Bukkit
  8. Post a link in chat.
  9. enjoy ;)

Dependencies


How does it Work?

When someone posts a link in chat, the plugin will submit an API request to the Adf.ly website. It will use your token(from config) in the request, and it will return a shortened link, tied to your account, which will link to the originally posted link.

Permission
adfly.bypass - Anyone with this permission will not have their links shortened.
adfly.bypass.chat - Anyone with this permission will not have their links shortened in chat.
adfly.bypass.command - Anyone with this permission will not have their links shortened in commands.

Config

  • api_token : This is your API token from the Adf.ly site. It will allow the links to be tied to your account, and give you money!
  • uid_token: This is your UID token from the Adf.ly site. So all links can be tied to account
  • ad_type: This specifies whether you want the normal wait 5 seconds, or display a banner on web page. (int=normal, banner=banner)
  • api_domain: this is the domain to use for shortening URL, I would not change this unless you are sure what you are doing.
  • url_list: this is the url list for the black or white list
  • url_list_type: blacklist or whitelist.. Blacklist forces only those links to change; whitelist prevents those links to change.
  • change_commands: This allows urls put in commands to be changed. Ex: (/msg test2 goto google.com) => Test sees (test1 -> test2: goto adf.ly/test)
  • message: This is the message that is sent when a user types a url in chat or a command.
Config Example
adfly:
  api_token: null
  uid_token: 'null'
  ad_type: int
  api_domain: adf.ly
auto_reload: 'true'
url_list:
- adf.lys
- j.gs
- q.gs
- example.com/asd
url_list_type: whitelist
change_commands: 'true'
bukkit:
  op_bypass: 'true'
message: "&a[&6ad&ff.ly&a] Sending message please wait..."
Blacklist example
# This is the list, all links in this list will be forced to change
url_list:
#You can specify hosts (shown as adf.ly) or full urls (shown in 'example.com/asd')
- adf.ly
- j.gs
- q.gs
- example.com/asd
url_list_type: blacklist
Whitelist example
# This is the list, all links in this list will be exempt from changing
url_list:
#You can specify hosts (shown as adf.ly) or full urls (shown in 'example.com/asd')
- adf.ly
- j.gs
- q.gs
- example.com/asd
url_list_type: whitelist


Supporting Me
There are 2 ways you can support me (CreepersHelp):

  1. Use my referral link- When signing up, please use my link.
  2. Donate - If you really liked the plugin, you can directly donate to me here

Similar projects

Plugin →