Results 1 to 5 of 5

Thread: Brainstorming Ideas for Small API Projects

  1. #1

    Brainstorming Ideas for Small API Projects

    Hey guys,

    I've got the API working for me and have fiddled around a bit, however my code is pretty scrappy since I don't have much of a clear direction with what I want to do. I'm not looking to build an insane website or anything, just want some handy pieces of code that I can run to assess how things are or maybe suggestions for progression. Does anyone have any ideas on projects I could code?

    The really basic stuff I've done so far is:
    - Count up how many of each town hall our clan has
    - Rank everyone in the clan based on whichever profile achievement I choose
    - Count up the clan's total donations (this one isn't so great cuz we have a feeder and quite a few members hop there to donate quickly, or participate in their cwl, and come back resetting their counters. I wish donations/receives to a clan were saved when someone comes back, anyway that's off topic)
    - Looked at cwl data a bit, before I go further with this, is it legal to use this data for your own cwl? It seems as though we can have access to the lineups of the other clans and other information that's typically kept hidden in the game.

    I know there are websites out there which use the API but they r a bit cluttered with features I don't need, and I'd also like to use something that I was able to code myself.

    Thanks for the help!

    Drag

    P.S. one idea I'd really love to code is a ranking based on activity (I'm really not sure how to progress with this and don't know what factors should be taken under consideration) I saw a website kinda do this, but it had like a bunch of us all with 10/10, I want to be able to display something where almost no one comes to a tie. Also, I'd like the ranking to be based off a formula I know and understand rather than something hidden. Any help on this idea would also be really appreciated!!!

  2. #2
    Quote Originally Posted by DragonDMS View Post
    - Count up the clan's total donations (this one isn't so great cuz we have a feeder and quite a few members hop there to donate quickly, or participate in their cwl, and come back resetting their counters. I wish donations/receives to a clan were saved when someone comes back, anyway that's off topic)
    FYI there's an achievement for tracking spells and troops donations if you want to track them outside of the clan profile.

    Quote Originally Posted by DragonDMS View Post
    - Looked at cwl data a bit, before I go further with this, is it legal to use this data for your own cwl? It seems as though we can have access to the lineups of the other clans and other information that's typically kept hidden in the game.
    They cannot fault you for looking at data they intentionally provide. The only advantage is you get a better idea of the TH distribution, and there's really not much advantage anyways, as by then your roster is set for the week

    Quote Originally Posted by DragonDMS View Post
    P.S. one idea I'd really love to code is a ranking based on activity (I'm really not sure how to progress with this and don't know what factors should be taken under consideration) I saw a website kinda do this, but it had like a bunch of us all with 10/10, I want to be able to display something where almost no one comes to a tie. Also, I'd like the ranking to be based off a formula I know and understand rather than something hidden. Any help on this idea would also be really appreciated!!!
    If you do create this, I would be really interested in looking at the formula, I've been meaning to do the same. Currently I look at gold grab and troop donations, which are two pretty obvious indicators of activity.

    Quote Originally Posted by DragonDMS View Post
    Hey guys,

    I've got the API working for me and have fiddled around a bit, however my code is pretty scrappy since I don't have much of a clear direction with what I want to do. I'm not looking to build an insane website or anything, just want some handy pieces of code that I can run to assess how things are or maybe suggestions for progression. Does anyone have any ideas on projects I could code?

    The really basic stuff I've done so far is:
    - Count up how many of each town hall our clan has
    - Rank everyone in the clan based on whichever profile achievement I choose

    I know there are websites out there which use the API but they r a bit cluttered with features I don't need, and I'd also like to use something that I was able to code myself.

    Thanks for the help!

    Drag
    Are you currently saving data into a database or only pulling live from the API as you go?

    I've got a couple projects that I'm working on that sound like they may interest you- I pull data, load it into a DB, and create various reports and graphs off of it. I also run a discord server that my bot uses all of this data on. Let me know if you'd be interested in taking a look/collaborating. If not, I'd definitely love to see what you come up with!

  3. #3
    Thanks for the reply!

    My code currently is just in python and it only pulls data live when I run it. I haven't yet stored data anywhere, originally I tried to figure out how to get my python code to update a local html page but couldn't figure it out. I had trouble creating an output from python that the html code/Java script could interpret and then display.

    Saving my info to a database sounds like a great idea but I'm not sure how to go about it. I'm a mechanical engineering student at the moment but am also very interested in coding. So I'm not the most experienced in the more complicated areas of computer science. For example, it took me a long time to get the API set up since I had never worked with one before, but the data manipulation part was easy since that type of coding was more familiar.

    Many of my ideas are halted by me not being able to constantly pull data every certain amount of time, since I'd have to keep my program running forever. Only way I can get close to this that I currently have the knowledge to do would be to run it once at the start of the season and write all the info to a text file or csv, then run it again a certain amount of days later and see the delta.

    It sounds like you've done some great work! I'd love to collaborate with you and hopefully learn some cool things along the way.

  4. #4
    Hi Dragon,

    I have currently been working in python as well to create a wrapper for the API and create a custom discord bot for my clan. I am currently using the bot to alert on loot gained each day, donations given. But the big gain is in CWL where we can get a good insight into the line up for each war and plan strategy around it ahead of time.

    We are able to rank players accordingly for bonus cwl trophies, using a custom formula that involves destruction, stars, attack up/down, own base destruction etc.

    Check out my github: I am currently in the process of making the whole process better and it lives in the v2 branch. You should be able to put in your clan tag and discord API key and everything else gets automated for you (or atleast that is the hope).

    https://github.com/adityapat3l/clash/tree/clashapp_v2

  5. #5
    Hi there,

    I also work in python - my current project is creating a live "donationboard" through a discord bot - when someone donates in claimed clan(s) it updates the donationboard, and sends a message to a log channel saying who donated/received and how much - it's cool because means you can track who donated to who and witchhunt the bad people


    Another thing you may or may not be interested in - I created a full asynchronous wrapper for the API, coc.py that makes working with the API a huge amount easier and I designed it with discord bots in mind - it's what I play with... all calls are asynchronous and no blocking will occur. It handles tokens with a changing IP address automatically, can get 100 players in seconds with `Client.get_players(tags)` that multithreads requests, and has a special "EventsClient" which will post callbacks when eg. someone donates or joins the clan, attacks in war, etc.
    If you're interested theres docs and source code etc. there and I'm happy to explain it some more...

    coc.py - https://github.com/mathsman5133/coc.py/
    my donation tracker bot - https://github.com/mathsman5133/donationbot

    mathsman
    Last edited by mathsman5132; July 11th, 2019 at 06:56 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •