Skip to content

Commit d18a0ed

Browse files
committed
update usage, description, and examples
1 parent 52e422a commit d18a0ed

File tree

1 file changed

+57
-57
lines changed

1 file changed

+57
-57
lines changed

README.md

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Instamancer is a new type of scraping tool that leverages Puppeteer's ability to
2222
Read more about how Instamancer works [here](https://scriptsmith.github.io/instamancer/).
2323

2424
### Features
25-
- Scrape hashtags and users
26-
- Output JSON, CSV
25+
- Scrape hashtags, users, and posts
2726
- Download images, albums, and videos
27+
- Output JSON, CSV
2828
- Batch scraping
2929
- Search hashtags, users, and locations
3030
- API response validation
@@ -50,8 +50,6 @@ Metadata that Instamancer is able to gather from posts:
5050
## Install
5151

5252
#### Linux
53-
See [Puppeteer troubleshooting](https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#chrome-headless-fails-due-to-sandbox-issues)
54-
5553
Enable user namespace cloning:
5654
```
5755
sysctl -w kernel.unprivileged_userns_clone=1
@@ -64,22 +62,15 @@ Or run without a sandbox:
6462
export NO_SANDBOX=true
6563
```
6664

65+
See [Puppeteer troubleshooting](https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#chrome-headless-fails-due-to-sandbox-issues)
66+
6767
#### Without downloading chromium
6868
If you wish to install Instamancer without downloading chromium, enable the `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD` environment variable before installation
6969

7070
```
7171
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
7272
```
7373

74-
### From this repository
75-
```
76-
git clone https://github.com/ScriptSmith/instamancer.git
77-
cd instamancer
78-
npm install
79-
npm run build
80-
npm install -g
81-
```
82-
8374
### From NPM
8475

8576
```
@@ -98,6 +89,15 @@ sudo npm install -g instamancer --unsafe-perm=true
9889
npx instamancer
9990
```
10091

92+
### From this repository
93+
```
94+
git clone https://github.com/ScriptSmith/instamancer.git
95+
cd instamancer
96+
npm install
97+
npm run build
98+
npm install -g
99+
```
100+
101101
## Usage
102102

103103
### Command Line
@@ -112,48 +112,48 @@ Commands:
112112
instamancer search [query] Perform a search of users, tags and places
113113
instamancer batch [batchfile] Read newline-separated arguments from a file
114114
115+
Configuration
116+
--count, -c Number of posts to download (0 for all) [number] [default: 0]
117+
--full, -f Retrieve full post data [boolean] [default: false]
118+
--sleep, -s Seconds to sleep between interactions [number] [default: 2]
119+
--graft, -g Enable grafting [boolean] [default: true]
120+
--browser, -b Browser path. Defaults to the puppeteer version [string]
121+
122+
Download
123+
--download, -d Save images from posts [boolean] [default: false]
124+
--downdir Download path [default: "downloads/[endpoint]/[id]"]
125+
--video, -v Download videos (requires full) [boolean] [default: false]
126+
--upload, -u Upload files to a URL with a PUT request [string]
127+
--sync Force download between requests [boolean] [default: false]
128+
--threads, -k Parallel download / upload threads [number] [default: 4]
129+
--waitDownload, -w Download media after scraping [boolean] [default: false]
130+
131+
Output
132+
--filename, --file, -o Name of the output file [string] [default: "[id]"]
133+
--filetype, --type, -t [choices: "csv", "json", "both"] [default: "json"]
134+
--mediaPath, -m Add filepaths to _mediaPath [boolean] [default: false]
135+
136+
Display
137+
--visible Show browser on the screen [boolean] [default: false]
138+
--quiet, -q Disable progress output [boolean] [default: false]
139+
140+
Logging
141+
--logging, -l [choices: "none", "error", "info", "debug"] [default: "none"]
142+
--logfile Log file name [string] [default: "instamancer.log"]
143+
144+
Validation
145+
--strict Throw an error on response type mismatch [boolean] [default: false]
146+
147+
Plugins
148+
--plugin, -p Use a plugin from the plugins directory [array] [default: []]
149+
115150
Options:
116-
--help Show help [boolean]
117-
--version Show version number [boolean]
118-
--count, -c Number of posts to download. 0 to download all
119-
[default: 0]
120-
--visible Show browser on the screen [boolean] [default: false]
121-
--download, -d Save images and videos from posts
122-
[boolean] [default: false]
123-
--graft, -g Enable grafting [boolean] [default: true]
124-
--full Get the full list of posts and their details from the
125-
API and web page [boolean] [default: false]
126-
--video Download videos. Only works in full mode
127-
[boolean] [default: false]
128-
--silent Disable progress output [boolean] [default: false]
129-
--strict Throw an error if types from Instagram API have been
130-
changed [boolean] [default: false]
131-
--sync Synchronously download files between API requests
132-
[boolean] [default: false]
133-
--threads, -k The number of parallel download / upload threads
134-
[number] [default: 4]
135-
--waitDownload, -w When true, media will only download once scraping is
136-
finished [boolean] [default: false]
137-
--filename, --file, -f Name of the output file [default: "[id]"]
138-
--filetype, --type, -t Type of output file
139-
[choices: "csv", "json", "both"] [default: "json"]
140-
--downdir Directory / Container to save media
141-
[default: "downloads/[endpoint]/[id]"]
142-
--mediaPath, --mp Store the paths of downloaded media in the
143-
'_mediaPath' key [boolean] [default: false]
144-
--logging Level of logger
145-
[choices: "error", "none", "info", "debug"] [default: "none"]
146-
--logfile Name of the log file [default: "instamancer.log"]
147-
--browser Location of the browser. Defaults to the copy
148-
downloaded at installation
149-
--upload Upload files to a URL with a PUT request rather than
150-
saving to disk
151-
--plugin Use a plugin from the plugins directory
152-
[array] [default: []]
151+
--help Show help [boolean]
152+
--version Show version number [boolean]
153153
154154
Examples:
155-
instamancer hashtag instagood -d Download all the available posts,
156-
and their thumbnails from #instagood
155+
instamancer hashtag instagood -fvd Download all the available posts,
156+
and their media from #instagood
157157
instamancer user arianagrande Download Ariana Grande's posts to a
158158
--filetype=csv --logging=info --visible CSV file with a non-headless
159159
browser, and log all events
@@ -165,13 +165,13 @@ Source code available at https://github.com/ScriptSmith/instamancer
165165

166166
ES2018 Typescript example:
167167
```typescript
168-
import {createApi,IOptions} from "instamancer"
168+
import {createApi, IOptions} from "instamancer"
169169

170170
const options: IOptions = {
171171
total: 10
172172
};
173-
174173
const hashtag = createApi("hashtag", "beach", options);
174+
175175
(async () => {
176176
for await (const post of hashtag.generator()) {
177177
console.log(post);
@@ -209,7 +209,7 @@ const options: Instamancer.IOptions = {
209209
sleepTime: number,
210210

211211
// Throw an error if type validation has been failed
212-
strict?: boolean,
212+
strict: boolean,
213213

214214
// Time to sleep when rate-limited
215215
hibernationTime: number,
@@ -227,10 +227,10 @@ const options: Instamancer.IOptions = {
227227
executablePath: string,
228228

229229
// Custom io-ts validator
230-
validator?: Type<unknown>,
230+
validator: Type<unknown>,
231231

232232
// Custom plugins
233-
plugins?: IPlugin[]
233+
plugins: IPlugin[]
234234
}
235235
```
236236

0 commit comments

Comments
 (0)