1.0.27 • Published 1 year ago

sentiment-widget v1.0.27

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

sentiment-widget

Quick Start

1. Import the packaged JS file

Create an html file and import the required libraries and the packaged js file in the header.

<!doctype html>
<html lang='en'>
<head>
  ...
  <title>Document</title>
  <script type="module" src="https://unpkg.com/sentiment-widget@1.0.14/dist/esm/sentiment.js"></script>

</head>
  ...
</html>

2. Use the tag

<!doctype html>
<html lang='en'>
<head>
  <meta charset='UTF-8'>
  <meta name='viewport'
        content='width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0'>
  <meta http-equiv='X-UA-Compatible' content='ie=edge'>
  <title>Document</title>
  <script type="module" src="https://unpkg.com/sentiment-widget@1.0.14/dist/esm/sentiment.js"></script>

</head>
<body>
<sentiment-widget></sentiment-widget>
</body>
</html>

3. Custom attributes

  • type-prop: Optional values are event and address and abstract, corresponding to key events and key addresses, with a default value of event.
  • lang-prop: Optional values are zh and en, corresponding to Chinese (traditional) and English, with a default value of zh.
  • api-key: Specify the api-key, the valid client will receive the realtime data update.
  • is-expand: Specify the is-expand as on, the widget will compress in the pop up window button, default is off

4. Example:

As basic user, if you want to initialize and display the event key event using the English interface widget, you can use:

<sentiment-widget type-prop='event' lang-prop='en'></sentiment-widget>
or
<sentiment-widget lang-prop='en'></sentiment-widget>

If you want to enable WebSocket subscription service, initialize and display the address key address using the English interface widget, you can use:

<sentiment-widget api-key='xxxxxxx' type-prop='address' lang-prop='en'></sentiment-widget>

After specify the api-key subscription service, the widget will update in real-time when new records arrive.

Websocket

Endpoint: wss://stream.areix-ai.com/public/ws

subscribe msg:

{'action': 'subscribe_sentiment', 'type':<type>, 'lang':<lang>, 'key':<key>, 'domain':<domain>}

Example:

{'action': 'subscribe_sentiment', 'type':'event', 'lang':'zh', 'key':'xxxxx', 'domain':'xxxx.com'}```
1.0.27

1 year ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.20

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

0.0.1

2 years ago