intel-screenbot

An Ingress Intel Map Bot for Hangoutsbot
git clone git://archive.git.mtrnord.blog/MTRNord/intel-screenbot.git
Log | Files | Refs | README | LICENSE

README.md (3734B)


      1 # Ingress Intel Screenbot
      2 
      3 Note: Most of the Code in `screencap.js` comes from [ingress-ice](https://github.com/nibogd/ingress-ice) which isn't made by me. So code Credits of it goes in the most parts to `nibogd`. I only modified it for the Bot.
      4 
      5 Requires: **PhantomJS** (installation instructions below)
      6 
      7 Requires: **[hangoutsbot](https://github.com/hangoutsbot/hangoutsbot)**
      8 
      9 Get and post a screenshot of the Intel Map.
     10 
     11 ## Known Bugs
     12 - Currently portalinfo seems to be 50% of the times broken. It will be fixed in the ongoing rewrite.
     13 
     14 ## Install
     15 To install the plugin you need to:
     16 
     17 1. Go into `<yourBotDir>/plugins/`
     18 2. Clone this repo into `intel_screenbot`
     19 3. Optional remove `README.md` `LICENSE` and `.gitignore` from `<yourBotDir>/plugins/intel_screenbot`
     20 4. Run `pip3 install -r requirements.txt`
     21 5. Follow Configuration.
     22 
     23 ## Configuration with Email Password
     24 
     25 **IMPORTANT: DO NOT USE YOUR MAIN ACCOUNT! I AM NOT RESPONSIBLE IF YOUR ACCOUNT GETS BANNED! USE AT YOUR OWN RISK**
     26 
     27 *Note: DON'T set cookies up when using email/password*<br \><br \>
     28 For using the Intel Screenbot you need to add the following json-code to the config.json:
     29 
     30 ```
     31  "intel_screenbot": {
     32    "email": "YOUR EMAIL",
     33    "password": "YOUR Password",
     34    "plugin_dirs": [
     35      "https://api.github.com/repos/iitc-project/iitc-project.github.io/git/trees/master?recursive=1"
     36    ]
     37  }
     38 ```  
     39 
     40 According to the official INSTALL Documention of the hangoutbot you will find the config.json in `/<username>/.local/share/hangupsbot/` <br \>
     41 (NOTE! add an comma behind the last element of the config.json and add it before the outer element closes)
     42 
     43 Also you need to add `intel_screenbot` to the plugins.
     44 
     45 ## How to add gitlab to plugin_dirs
     46 
     47 1. Open in browser: `https://gitlab.com/api/v3/projects/search/:REPO_NAME`
     48 2. copy the number in `id`
     49 3. add `http://gitlab.com/api/v3/projects/:ID/repository/tree` to `plugin_dirs`
     50 4. add `"gitlab_token":"YOUR_GITLAB_API_TOKEN"` to `intel_screenbot`
     51 
     52 *Note: repos are currently locked to master branch*
     53 
     54 ## How to add github to plugins_dir
     55 
     56 1. add `https://api.github.com/repos/:REPO_USER/:REPO_NAME/git/trees/master?recursive=1`
     57 
     58 *Note: repos are currently locked to master branch*
     59 
     60 ## How to add local files to plugins_dir
     61 
     62 1. just add the absolute path to `plugins_dir` (relative paths are not tested)
     63 
     64 ## Admin Commands
     65 
     66 `/bot setintel [url]`
     67 * Sets the default Intel URL of a particular hangout.  
     68 * If no url provided it will be cleared
     69 
     70 `/bot show_iitcplugins`  
     71 * Shows every availible IITC-plugin.
     72 
     73 `/bot set_iitcplugins <plugin names devided by whitespace>`  
     74 * Sets the plugins to use with IITC per hangout.
     75 
     76 `/bot clear_iitcplugins`  
     77 * Clear the plugins to use with IITC per hangout.
     78 
     79 
     80 ## User Command
     81 
     82 `/bot intel [[url] or [searchTerm]] [z=zoomlevel]`
     83 * Provide an arbitrary `<url>` to take a screenshot
     84 * If no `<url>` is supplied, use the default screenshot URL (or reply with an error if no URL is set)
     85 * `z=` lets you change the zoomlevel of the map
     86 
     87 `/bot iitc [[url] or [searchTerm]] [z=zoomlevel]`
     88 * Provide an arbitrary `<url>` to take a screenshot
     89 * If no `<url>` is supplied, use the default screenshot URL (or reply with an error if no URL is set)
     90 * `z=` lets you change the zoomlevel of the map
     91 
     92 `/portalpic <url>`
     93 * Makes a screenshot of the Portalinfo of the defined portal.
     94 
     95 `/portalinfo <url>`
     96 * Gives you a text version of the most important Portal Information. (Pretty long!)
     97 
     98 ## PhantomJS Installation
     99 
    100 Only tested way to install:
    101 
    102 ```
    103 wget https://cnpmjs.org/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
    104 tar xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2
    105 mv phantomjs-2.1.1-linux-x86_64 /usr/local/share
    106 ln -sf /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin
    107 ```