@@ -10,46 +10,82 @@ Visit [here](https://php-simple-web-scraper.herokuapp.com/).
1010
1111## Usage
1212
13+ ### Basic Usage
1314Perform an HTTP request with the ` url ` query parameter and encoded URL as a value.
1415
1516```
1617http(s)://{app-address}/?url={encoded target url}
1718```
1819
19- ### Example
20+ #### Example
2021```
2122http(s)://{app-address}/?url=https%3A%2F%2Fgithub.com
2223```
2324
24- ## Supported Ouput Types
25+ ### Parameters
26+ #### output
27+ Determines the output type, which includes ` html ` , ` json ` , ` screenshot ` .
2528
26- ###HTML (default)
29+ ##### html (default)
2730
2831HTML source code of the target web site. JavaScript generated contents are also retrieved and dumped.
2932
30- ### JSON
31- HTTP response data as JSON. Useful for cross site communications with JSONP.
33+ ##### json
3234
33- #### Parameter
3435` output=json `
3536
36- #### Example
37+ HTTP response data as JSON. Useful for cross site communications with JSONP.
38+ 39+ ###### Example
3740```
3841http(s)://{app-address}/?url=https%3A%2F%2Fgithub.com&output=json
3942```
4043
41- ### Screenshot (Web Snapshot)
42- A jpeg image of the site snapshot.
44+ ##### screenshot
4345
44- 45- #### Parameter
4646` output=screenshot `
4747
48- #### Example
48+ A jpeg image of the site snapshot.
49+ 50+ ###### Example
4951```
5052http(s)://{app-address}/?url=https%3A%2F%2Fgithub.com&output=screenshot
5153```
5254
55+ #### user-agent
56+ Sets a custom user agent. By default, a random user-agent will be assigned. You can change it by specifying the value with this parameter.
57+ 58+ ##### Example
59+ To set a user agent, ` Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100102 Firefox/57.0 ` ,
60+ ```
61+ http(s)://{app-address}/?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-http-headers-is-my-browser-sending&user-agent=Mozilla/5.0%20(Windows%20NT%206.1;%20Win64;%20x64;%20rv:57.0)%20Gecko/20100102%20Firefox/57.0
62+ ```
63+ 64+ #### headers
65+ Sets a custom HTTP headers. Accepts the value as an array.
66+ 67+ ##### Example
68+ To set ` DNT ` value,
69+ ```
70+ http(s)://{app-address}/?url=https%3A%2F%2Fwww.whatismybrowser.com%2Fdetect%2Fwhat-http-headers-is-my-browser-sending&headers[DNT]=1
71+ ```
72+ 73+ #### method
74+ HTTP request method. Default: ` GET ` . Accepts the followings.
75+ - OPTIONS
76+ - GET
77+ - HEAD
78+ - POST
79+ - PUT
80+ - DELETE
81+ - PATCH
82+ 83+ When using ` POST ` , give sending post data with the ` data ` request key. The program checks ` $_REQUEST[ 'data' ] ` to send POST data.
84+ ##### Example
85+ ```
86+ http(s)://{app-address}/?url=http%3A%2F%2Fhttpbin.org%2Fpost&method=POST&data[foo]=bar
87+ ```
88+ 5389## Run as Heroku Application
5490This is a Heroku application and meant to be deployed to a [ Heroku] ( https://dashboard.heroku.com/ ) application instance.
5591
0 commit comments