<commit_before>loklak webclient
=====================================
[![Build Status](https://travis-ci.org/loklak/loklak_webclient.svg?branch=master)](https://travis-ci.org/loklak/loklak_webclient)

Web client for loklak server (see: https://github.com/loklak/loklak_server ).
To use the loklak webclient, you need a running loklak server.
Install and run it first.

---

### Build

1. Install git, nodejs, nasm, libpng-dev, dh-autoreconf
2. Clone this repo from `https://github.com/loklak/loklak_webclient.git`
3. Create your custom settings file by doing
   `cp configFile.json custom_configFile.json`.
   Edit your settings inside `custom_configFile.json`.
4. Run `npm install` from the root directory **AND** from `oauth-proxy` subdirectory, **AND** from `iframely`

### Add twitter credentials
Create an twitter application at `https://apps.twitter.com`, remember to set the correct website url & callback url (for localhost, `http://127.0.0.1/` works better), then modify `custom_configFile.json`:
1. Set the twitterConsumerKey var in `custom_configFile.json`
  to set the Consumer Key (API Key) from your Twitter app
2. Set the twitterConsumerSecret var in `custom_configFile.json`
  to set the Consumer Secret from your Twitter app  

A twitter app is valid only for a domain (defined when creating the app). So the credentails above need to be changed also according to the domain (e.g. you'll need to create 2 twitter apps separately for a clone in localhost and for a clone in a remote server)

### Loklak server
See here to run your own https://github.com/loklak/loklak_server (reccommended), and change `apiUrl` in config accordingly. Last resource, or for production is `http://loklak.org/api/`

### Iframely Link Debugging server
Link debugging server is essential to embed rich contents from tweets, e.g. videos, links, articles, photos, ..etc. This need to be ran separately, just like the loklak server. Go to `./iframely`, and run `node server`. It's a **MUST** to be in `./iframely` folder when executing the service. `pm` or *nix `screen` can help managing this service in the background.

## Development
After adding twitter credentials and `apiUrl`, you can leave the rest as is and run `gulp dev` for development. `gulp dev` includes an express server to serve the build at `gulpDevExpressPort`, a proxy server at `oauthProxyPort`, and `browser-sync` at 3000. A browser window will be opened automatically.

For a remote server, along with twitter credential for the remote server: change all `localhost` to your domain e.g. `"oauthProxyUrl": "http://mydomain.org:3002/oauthproxy"`

## Production
We recommend using `screen` of `pm2` to manage your node processes.
<commit_msg>Add Gitter badge<commit_after>loklak webclient
=====================================

[![Join the chat at https://gitter.im/loklak/loklak_webclient](https://badges.gitter.im/loklak/loklak_webclient.svg)](https://gitter.im/loklak/loklak_webclient?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/loklak/loklak_webclient.svg?branch=master)](https://travis-ci.org/loklak/loklak_webclient)
[![Code Climate](https://codeclimate.com/github/loklak/loklak_webclient/badges/gpa.svg)](https://codeclimate.com/github/loklak/loklak_webclient)

Web client for loklak server (see: https://github.com/loklak/loklak_server ).
To use the loklak webclient, you need a running loklak server.
Install and run it first.

---

### Build

1. Install `git`, `npm`, `nodejs`, `nasm`, `libpng-dev` and `dh-autoreconf`packages. 
   Run the commands as:
    * `sudo apt-get install git-core`
    * `sudo apt-get install npm`
    * `sudo apt-get install nodejs`
    * `sudo apt-get install nasm`
    * `sudo apt-get install libpng-dev`
    * `sudo apt-get install dh-autoreconf`
2. Run `sudo npm install -g gulp` to install `gulp` systemwide as a tool to run the task.
3. Clone this repo from `https://github.com/loklak/loklak_webclient.git`
4. Create your custom settings file by doing
   `cp configFile.json custom_configFile.json`.
   Edit your settings inside `custom_configFile.json`.
5. Run `npm install` from the root directory **AND** from `oauth-proxy` subdirectory, **AND** from `iframely`

### Add twitter credentials
Create a Twitter application at [https://apps.twitter.com](https://apps.twitter.com), remember to set the correct website url & callback url (for localhost, `http://127.0.0.1/` works better), then modify `custom_configFile.json` as:
* Set the twitterConsumerKey var in `custom_configFile.json` to set the Consumer Key (API Key) from your Twitter app
* Set the twitterConsumerSecret var in `custom_configFile.json` to set the Consumer Secret from your Twitter app  

A twitter app is valid only for a domain (defined when creating the app). So the credentails above need to be changed also according to the domain (e.g. you'll need to create 2 twitter apps separately for a clone in localhost and for a clone in a remote server)

### Loklak server
See here to run your own https://github.com/loklak/loklak_server (reccommended), and change `apiUrl` in config accordingly. Last resource, or for production is `http://loklak.org/api/`

### Iframely Link Debugging server
Link debugging server is essential to embed rich contents from tweets, e.g. videos, links, articles, photos, ..etc. This need to be ran separately, just like the loklak server. Go to `./iframely`, and run `node server`. It's a **MUST** to be in `./iframely` folder when executing the service. `pm` or *nix `screen` can help managing this service in the background.

## Development
After adding twitter credentials and `apiUrl`, you can leave the rest as is and run `gulp dev` for development. `gulp dev` includes an express server to serve the build at `gulpDevExpressPort`, a proxy server at `oauthProxyPort`, and `browser-sync` at 3000. A browser window will be opened automatically.

For a remote server, along with twitter credential for the remote server: change all `localhost` to your domain e.g. `"oauthProxyUrl": "http://mydomain.org:3002/oauthproxy"`

## Production
We recommend using `screen` of `pm2` to manage your node processes.

{'fraction_non_alphanumeric': 0.11181229773462784, 'fraction_numerical': 0.0069579288025889965, 'mean_word_length': 4.670642201834863, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1606439', 'n_tokens_mistral': 1938, 'n_tokens_neox': 1861, 'n_words': 752}