Git Product home page Git Product logo

likefordi's Introduction

LikeForDi

This program is a like for DI bot to be used in groupme and uses the sharepoint REST API to update DI for a squad.

How to use

There are four blank fields in the config.json:

  1. To start, chose a name for your bot and enter it as the value for "bot-name". This value is who FalconNet thinks signed someone's DI. I used my name so the FalconNet admins wouldn't flag it as suspicious.
  2. Go to https://dev.groupme.com/ and create an application for your bot. Copy your access token into the value for "groupme-api-key".
  3. Make a GET request to 'https://api.groupme.com/v3/groups?token='. In the returned info, search for your squads group id. Copy the returned group-id into the "group-id" field. I recommend the Postman application to help with api calls.
  4. In the "lookup-table-location" field, notice how it references a file called lookup. You will need to make your own file with everyone's groupme id and sharepoint id separated by a colon. For example: 38879355:4014. Each pairing should have its own line.
    1. You can get all the groupme ids for your squad by sending a GET request to 'https://api.groupme.com/v3/groups/?token='
    2. To get all the sharepoint ids, you can ask everyone in squad to send you theirs, or you can send an api request to sharepoint. The api request should be to 'https://usafa0.sharepoint.com/sites/LoFiDI/_api/web/lists/GetByTitle('Cadet Roster')/Items?$filter=(pysw eq 'CS')' but to make it easy paste that in your browser and sort through the returned xml yourself or with a online xml beautifier. The ID should be in the <d:Id m:type="Edm.Int32"> tag.
    3. If you can't find everyone using the last api request, you can also search using their name: https://usafa0.sharepoint.com/sites/LoFiDI/_api/web/lists/GetByTitle('Cadet%20Roster')/Items?$filter=substringof(%27%27,Title). Again, the ID should be in the <d:Id m:type="Edm.Int32"></d:Id> tag.
  5. Finally, for the "sharepoint-cookie", use your browser to go to "https://usafa0.sharepoint.com/sites/LoFiDI/Lists/Cadet%20Roster/NoItems.aspx". Go to Inspect Element, the Network tab, and then refresh the page. Click on the first item that shows up. At the bottom of the Headers tab, there should be a field called cookie. Copy the whole value into the "sharepoint-cookie" field. Since cookies expire regularly, you will have to do this about one a week.
  6. A safeguard is enabled by default. To make the program run, update the field "simulate" from 1 to 0.

The program should now work. The default behavior of the program is to only send one group message. The field "annoying-level" will change that

Annoying-level values

Annoying level Behavior
1 Will send only one group message
2 Will send two group messages
3 Will send two group messages and will dm group members who haven't signed

Development

If you would like to help to develop this project I would appreciate it. Just submit a pull request with the changes. Try to keep the code looking nice and to the same format. I will try to put issues up that I think the project could use but you are welcome to help any part of it.

likefordi's People

Contributors

qrk1tt13 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.