AdflyPlugin 4.1

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

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

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

    Master: [​IMG]
    ttttDev: [​IMG]

    **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.**


    [​IMG]

    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.
    Code (Text):

    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..."

     
    Code (Text):
    # 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
    Code (Text):
    # 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 [​IMG]
    Nahid, Bilhus, Hyedryn and 2 others like this.

Recent Reviews

  1. Denis_024587
    Denis_024587
    1/5,
    Version: 4.1
    Can you please help me with this error? I use the spigot version

    [18:40:06 WARN]: java.lang.IllegalArgumentException: No enum constant com.CreepersHelp.adfly.api.AdTypes.NONE
    [18:40:06 WARN]: at java.lang.Enum.valueOf(Enum.java:238)
    [18:40:06 WARN]: at com.CreepersHelp.adfly.api.AdTypes.valueOf(AdTypes.java:1)
    [18:40:06 WARN]: at com.CreepersHelp.adfly.api.AdTypes.getEnum(AdTypes.java:17)
    [18:40:06 WARN]: at com.CreepersHelp.adfly.bukkit.listeners.MainListener.filter(MainListener.java:124)
    [18:40:06 WARN]: at com.CreepersHelp.adfly.bukkit.listeners.MainListener.onChat(MainListener.java:98)
    [18:40:06 WARN]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [18:40:06 WARN]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    [18:40:06 WARN]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [18:40:06 WARN]: at java.lang.reflect.Method.invoke(Method.java:498)
    [18:40:06 WARN]: at us.Myles.PWP.TransparentListeners.PerWorldPluginLoader$1.execute(PerWorldPluginLoader.java:120)
    [18:40:06 WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
    [18:40:06 WARN]: at us.Myles.PWP.TransparentListeners.PWPRegisteredListener.callEvent(PWPRegisteredListener.java:30)
    [18:40:06 WARN]: at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502)
    [18:40:06 WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:484)
    [18:40:06 WARN]: at net.minecraft.server.v1_8_R3.PlayerConnection.chat(PlayerConnection.java:1084)
    [18:40:06 WARN]: at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1022)
    [18:40:06 WARN]: at net.minecraft.server.v1_8_R3.PacketPlayInChat$1.run(PacketPlayInChat.java:39)
    [18:40:06 WARN]: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    [18:40:06 WARN]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    [18:40:06 WARN]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    [18:40:06 WARN]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    [18:40:06 WARN]: at java.lang.Thread.run(Thread.java:745)
  2. nikklo98
    nikklo98
    2/5,
    Version: 4.1
    Good Plugin, Good Concept, everything works until i notice in my adfly account no links get saved and it doesn't count the visitors i have made sure the api key and token are correct i double triple checked i even tried the secret api key but it still doesnt save them to my account.
    When this works i will give a 5 star rating.
  3. Ikeetjeop
    Ikeetjeop
    5/5,
    Version: 4.1
    Can you add (If i add a permission etc..):

    ReplaceUrlsCommands:
    - msg
    - w
    - r
    - mail
    - m
    - t
    - whisper
    - emsg
    - tell
    - er
    - reply
    - ereply
    - email
    - action
    - describe
    - eme
    - eaction
    - edescribe
    - etell
    - ewhisper
    - pm

    (Special for u :p)
  4. symvizan
    symvizan
    5/5,
    Version: 4.1
    -RULES: Do not post links to the public chat.-
    RULES: Post as many links to the chat as you can.

    Good job!
  5. Lcswolf
    Lcswolf
    5/5,
    Version: 4.1
    This is awesome especially with the difficulty funding servers keeping EULA compliant looking forward to a update keep up the awesome work
  6. KingRaptor345
    KingRaptor345
    5/5,
    Version: 4.1
    I love it! But I have one question. When I copy my API key which one do I use. In my account there is a "Public API Key" and a "Secret API Key" Which one do I use. Also thanks for making this plugin!!!
  7. PixxyKilljoy
    PixxyKilljoy
    5/5,
    Version: 4.1
    When I saw this plugin, I flipped out. This is genius and amazing! Fantastic, love it. Hope it stays updated!
    1. Creepers
      Author's Response
      I do plan to update it soon. I've just been so busy with work and other life things. Also, thank you for the review it shows that there is still interest in this plugin
  8. Cenastor
    Cenastor
    5/5,
    Version: 4.1
    Awesome plugin! Help your server even with people spamming links. Hope to see this plugin stay active =)
    1. Creepers
      Author's Response
      Thanks, and it should stay active. Yes, there will be inactive times when I get busy with school and work, but that's life. ;)
  9. Gimmes
    Gimmes
    5/5,
    Version: 2.5
    Great plugin!
    1. Creepers
  10. Shark998
    Shark998
    5/5,
    Version: 2.2
    So cool idea :3 You deserve 5 stars!
    1. Creepers