Qlik Community

Qlik Connectors Discussions

Discussion Board for collaboration regarding Qlik Connectors.

Highlighted
Partner
Partner

Using Sentiment Analysis

Hi all,

I'm new in sentiment140 web connector in Qlik Sense. I found some documents about Sentiment 140 Qlik web connector, but it works very slow. Is there any way to optimize it?

 

let vQwcConnectionName = 'lib://----------------';

Sub urlEncode(str)

let str=replace(str, '%', '%25'); // should be first
let str=replace(str, '#', '%23');
let str=replace(str, ' ', '%20');
let str=replace(str, '$', '%24');
let str=replace(str, '&', '%26');
let str=replace(str, '+', '%2B');
let str=replace(str, ',', '%2C');
let str=replace(str, '/', '%2F');
let str=replace(str, '\', '%5C');
let str=replace(str, ':', '%3A');
let str=replace(str, ';', '%3B');
let str=replace(str, '=', '%3D');
let str=replace(str, '?', '%3F');
let str=replace(str, '@', '%40');
let str=replace(str, '[', '%5B');
let str=replace(str, ']', '%5D');
let str=replace(str, '>', '%3E');
let str=replace(str, '<', '%3C');
let str=replace(str, chr(10), '%0A'); // Line feed.
let str=replace(str, chr(39), '%27'); // 39 Apostrophe

End sub


LET noRows = NoOfRows('TwitterConnector_Search');

for i=0 to $(noRows)-1

let text = peek('Search_text', $(i), 'TwitterConnector_Search');
let textEncoded = text;
call urlEncode(textEncoded);

Sentiment:
LOAD
'$(text)' as text,
status as Sentiment_status,
text as Sentiment_text,
score as Sentiment_score
FROM [$(vQwcConnectionName)]
(URL IS [http://localhost:5555/data?connectorID=TextAnalyser_Sentiment140Connector&table=Sentiment&text=$(textEncoded)&Language=en&appID=],qvx);

 

Any help would be greatly appreciated!