Skip to content

Instantly share code, notes, and snippets.

Avatar

Dimitris-Ilias Gkanatsios dgkanatsios

View GitHub Profile
@dgkanatsios
dgkanatsios / sentimentanalysisgreek.js
Last active Apr 21, 2018
Sentiment analysis via Azure Text Analytics API
View sentimentanalysisgreek.js
const request = require('request');
const fs = require('fs');
const url = 'https://westus.api.cognitive.microsoft.com/text/analytics/v2.0/sentiment';
const textanalyticskey = '<YOUR_TEXT_ANALYTICS_KEY>';
const data = JSON.parse(fs.readFileSync('test.json', 'utf8'));
request.post(url,
{
View ingress-ssl.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
name: ingress
spec:
rules:
- host: samplebot.dgkanatsios.com
View samplebot.js
const restify = require('restify');
const builder = require('botbuilder');
const os = require('os');
const server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
console.log('%s listening to %s', server.name, server.url);
});
var connector = new builder.ChatConnector({
View Dockerfile
FROM node:boron
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
COPY samplebot.js /usr/src/app
EXPOSE 3978
CMD [ "node", "samplebot" ]
View deploy.yaml
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: samplebot
labels:
name: samplebot
app: demo
spec:
replicas: 1
template:
@dgkanatsios
dgkanatsios / test.json
Last active Jul 4, 2017
Reviews in Greek
View test.json
[
{
"id": "1",
"text": "Δυσκολεύομαι να πιστέψω ότι υπάρχουν πράγματα που λειτουργούν τέλεια στην Ελλάδα. Ευχαριστώ και συγχαρητήρια για την προσπάθειά σας!"
},
{
"id": "2",
"text": "Όλα καλά. Ευχαριστώ πολύ!!"
},
{
@dgkanatsios
dgkanatsios / LoopWhileDialog.cs
Created May 11, 2017
A LoopWhileDialog for BotBuilder C# SDK
View LoopWhileDialog.cs
using Microsoft.Bot.Builder.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
namespace ParkAroundBot.CustomDialog
{
public static class Extensions
View ParkAroundBotProcessFinished.cs
private async Task ProcessFinished(IDialogContext ctx, IAwaitable<bool> confirmation)
{
bool userConfirmed = await confirmation;
if (userConfirmed == false)
{
ctx.Done("finished");
return;
}
result = await
View FullNameInputDialog.cs
[Serializable]
public class FullnameInputDialog : IDialog<string>
{
public async Task StartAsync(IDialogContext context)
{
var msg = context.MakeMessage();
var attachments = new List<Attachment>();
msg.AttachmentLayout = AttachmentLayoutTypes.List;
var actions = new List<CardAction>()
View DateTimeInputDialog.cs
[Serializable]
public class DateTimeInputDialog : IDialog<DateTime>
{
/// <summary>
/// If it is null, we're looking for DateTimeFrom
/// Else, we're looking for DateTimeTo
/// </summary>
private DateTime? inputDateTime;
private ParkingAreaDetails selectedParkingLocationDetails;
You can’t perform that action at this time.