start: npm i
build: npm run build
Run: (node) node lib/app (pm2) pm2 lib/app.js
src/getUrl.js
const baseurl
set base address for scrapper. https://m.facebook.com recomanded, https://facebookcorewwwi.onion if using Tor.
const proxy
set proxy address if using. Note that ports needs to be open in server.
const useProxy
Enable/disable proxy usage
If using tor as proxy, install tor on the server/dev env by instructions:
linux: https://www.torproject.org/docs/tor-doc-unix.html.en
OSX/MacOS: https://www.torproject.org/docs/tor-doc-osx.html.en
scraping data is done by selectors.
src/parser - Add/edit selectors:
selectors
Add/edit search strings (for text search):
search
each selector type can have multiple selector options to be scrapped. 1st selector that returnes data - will be returned.
/PageSamples
Page samples from returned data, to be used to analyze selectors and responses.
get your cookie by:
- log to facebook with your account
- open network in developr tools
- find any HTML resource call
- find it's request headers
- copy the "Cookie" header
add your cookie at the end of every call, as in the sample:
https://serveraddress/endpoint?param=param&coockie=YourFacebookCookie
- getLikes param: id / full url (everything after the domain name)
- getShares param: id / full url (everything after the domain name)
- getFrinds param: name / id
for load testing:
- testPage param: (everything after the domain name)