SMART-TBI Interpretation Extension
-
Clone GitHub repository:
git clone https://github.com/smart-tbi/smart-tbi -
Navigate to Directory:
cd interpretation -
Install dependencies with npm:
npm install -
Run extension in new chrome instance:
npm run start:chrome -
This will open a new chrome window and will have the extension pre-installed for you to test. Any changes made to the source code will be re-compiled and updated on the extension.
-
Clone the repository, navigate to it and install dependencies as steps 1-3 above.
-
Start a production build:
npm run build -
A folder named
extensionwith the production build files will be created. -
You can distribute this folder unpacked or compress to a .zip file and distribute.
-
Go to Chrome browser the go to -> "Settings" -> then go to "Extensions" or you can directly visit this link in your Chrome browser: "chrome://extensions/"
-
Click on "Load unpacked" and select the folder or .zip file from step 4 above.
-
Your extension should be loaded in Chrome and you can pin it from the top-right corner of the Toolbar.
-
Post elements have a
data-pageletattribute that starts withFeedUnitorrole="article"attribute. In most situations, the posts are enclosed by adivwithrole="feed"and we can use the same to filter out the true posts. -
The text inside each post is scraped using the
text-alignstyle attribute. However, when doing we smoe times also scrape the first comment. To filter out the comments from the post text, we check the parent div of the text and see if it contains anaria-labelattribute that mentionscomment. -
To find the See More button inside the Post, we search for a div with
role="button"attribute and we further seach for theinnerTextproperty to be"See More"