Skip to content

Instantly share code, notes, and snippets.

View abaranovskis-redsamurai's full-sized avatar
🚩
Coding

Andrej Baranovskij abaranovskis-redsamurai

🚩
Coding
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# split data into X and y
X = encoded_data.iloc[:, 1:44]
Y = encoded_data.iloc[:, 0:1]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abaranovskis-redsamurai
abaranovskis-redsamurai / twittersentiment.html
Created December 22, 2018 10:50
twittersentiment.html
<div class="oj-flex-item">
<oj-chart id="c1" type="pie" series="[[pieSeriesValue]]" groups="[[pieGroupsValue]]"
style-defaults.pie-inner-radius="0.7" animation-on-data-change="auto" pie-center.label="[[centerLabel]]"
pie-center.label-style="[[labelStyle]]" style="max-width:500px;width:100%;height:350px;">
</oj-chart>
</div>
<div class="oj-flex-item">
<h5 data-bind="text: 'Escalated Tweets'"></h5>
<oj-list-view id="l1" aria-label="Tweets for escalation" style="width:100%;height:550px;overflow-x:hidden" data="[[dataProvider]]"
selection-mode="none">
@abaranovskis-redsamurai
abaranovskis-redsamurai / twittersentiment.js
Last active December 22, 2018 10:44
twittersentiment.js
self.twitterSentimentAnalysis = function () {
document.getElementById("it1").validate();
var tracker = document.getElementById("tracker");
// Validate UI field, before executing function logic
if (tracker.valid === "valid") {
// Execute call to Node.js backend and pass Twitter account name to analyse support requests which require escalation
$.ajax({
url: "http://*****:3000/katana-backend/sentiment/twitter",
var express = require('express');
var request = require("request");
var router = express.Router();
// Using Twit library to interact with Twitter API - https://www.npmjs.com/package/twit
var Twit = require('twit');
var T = new Twit({
consumer_key: '*****',
consumer_secret: '*****',
@abaranovskis-redsamurai
abaranovskis-redsamurai / app.js
Last active December 22, 2018 09:11
Node.js routing
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
const cors = require('cors');
// Loading Node.js modules
var invoiceriskRouter = require('./routes/invoicerisk');
var twitterRouter = require('./routes/twitter');