This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
import datetime | |
import sys | |
import json | |
import re | |
#change the file name here. the file is generate by ytCommentMiner | |
dumpFile = open('videoei2-RjJDBHc2017-11-20-1200.json') | |
json_data = json.load(dumpFile) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nltk | |
import csv | |
import pickle | |
from nltk.tokenize import word_tokenize | |
from nltk.corpus import stopwords | |
from sklearn.naive_bayes import MultinomialNB | |
from myclassify import Analise | |
from pandas import DataFrame | |
import numpy | |
from sklearn.feature_extraction.text import CountVectorizer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nltk | |
import csv | |
import pickle | |
from nltk.tokenize import word_tokenize | |
from nltk.corpus import stopwords | |
from sklearn.naive_bayes import MultinomialNB | |
from myclassify import Analise # this should be found here: https://gist.github.com/ssisaias/fc49e7983a244b8c29b8f069f263216a | |
from pandas import DataFrame | |
import numpy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 2018 - Isaias S. Silva | |
# This script converts the sentistrength output to a CSV one with zeros and ones, so we can use in a two class classifier. | |
import requests | |
import time | |
import datetime | |
import sys | |
import json | |
#Attention to the file names bellow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var obj = JSON.parse(fs.readFileSync('fileURI', 'utf8')); | |
total = 0; | |
// obj is the root element; you can change <items> for whatever array you like | |
obj.items.forEach(element => { | |
if(element.snippet.totalReplyCount>0){ | |
element.replies.comments.forEach(reply => { | |
total++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Login config | |
@Autowired | |
public void configAuthentication(AuthenticationManagerBuilder auth_1, AuthenticationManagerBuilder auth_2) throws Exception { | |
auth_1.jdbcAuthentication().dataSource(dataSource) | |
.usersByUsernameQuery( | |
"select login,password,1 from table1 where login=?") | |
.authoritiesByUsernameQuery( | |
"select login,role from table1 where login=?"); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ClassicSingleton { | |
private static ClassicSingleton instance = null; | |
protected ClassicSingleton() { | |
// Exists only to defeat instantiation. | |
} | |
public static ClassicSingleton getInstance() { | |
if(instance == null) { | |
instance = new ClassicSingleton(); | |
} | |
return instance; |
NewerOlder