1
1
# exportcomments-php
2
+
2
3
Official PHP client for the ExportComments API. Export Social Media Comments from your PHP apps.
3
4
4
- Autoload
5
- --------
5
+ ## Autoload
6
6
7
7
The first step to use ` exportcomments-php ` is to download composer:
8
8
@@ -11,28 +11,29 @@ $ curl -s http://getcomposer.org/installer | php
11
11
```
12
12
13
13
Then we have to install our dependencies using:
14
+
14
15
``` bash
15
16
$ php composer.phar install
16
17
```
18
+
17
19
Now we can use autoloader from Composer by:
18
20
19
21
``` json
20
22
{
21
- "require" : {
22
- "exportcomments/exportcomments-php" : " ~0.1"
23
- }
23
+ "require" : {
24
+ "exportcomments/exportcomments-php" : " ~0.1"
25
+ }
24
26
}
25
27
```
26
28
27
29
Or, if you don't want to use composer, clone the code and include this line of code:
28
30
29
31
require 'autoload.php';
30
32
31
-
32
- Usage examples
33
- --------------
33
+ ## Usage examples
34
34
35
35
Here are some examples of how to use the library in order to create and use exports:
36
+
36
37
``` php
37
38
require 'autoload.php';
38
39
@@ -42,6 +43,7 @@ $export = new ExportComments\Client('<YOUR API KEY HERE>');
42
43
```
43
44
44
45
Create export
46
+
45
47
``` php
46
48
// Create a new export
47
49
$data = array('url' => 'https://www.facebook.com/post/123456789', 'replies' => false, 'twitterType' => null);
@@ -53,16 +55,35 @@ var_dump($res);
53
55
Response
54
56
55
57
``` json
56
-
57
58
{
58
- "uniqueId" : " dfd6a2f2-5579-421f-96ac-98993d0edea1" ,
59
- "date_created" : " 2016-08-26T11:44:09+00:00" ,
60
- "status" : false ,
61
- "error" : null
59
+ "code" : 200 ,
60
+ "success" : true ,
61
+ "data" : {
62
+ "url" : " https://www.instagram.com/p/1234567" ,
63
+ "guid" : " 2cfb0b9d-7633-4341-a702-cb889fe549eb" ,
64
+ "status" : " done" ,
65
+ "replies" : false ,
66
+ "fileName" : " comments5ea4b4d5a7602-1325511884314646.xlsx" ,
67
+ "fileNameRAW" : " 08b735760a5a40eb1fd70ca16e97aed3-2e0916fe-de86-4422-8449-fb608cbe5221.json" ,
68
+ "total" : 100 ,
69
+ "totalExported" : 98 ,
70
+ "retry" : 0 ,
71
+ "error" : null ,
72
+ "repliesCount" : 0 ,
73
+ "twitterType" : null ,
74
+ "timezone" : " UTC" ,
75
+ "createdAt" : " 2016-08-26T07:32:27+00:00" ,
76
+ "updatedAt" : " 2016-08-26T07:32:27+00:00" ,
77
+ "exportedAt" : " " ,
78
+ "downloadUrl" : " /exports/comments5ea4b4d5a7602-1325511884314646.xlsx" ,
79
+ "rawUrl" : " /exports/08b735760a5a40eb1fd70ca16e97aed3-2e0916fe-de86-4422-8449-fb608cbe5221.json"
80
+ },
81
+ "message" : null
62
82
}
63
-
64
83
```
65
84
85
+ ````
86
+
66
87
Checking export status
67
88
68
89
```php
@@ -71,32 +92,40 @@ $uniqueId = 'dfd6a2f2-5579-421f-96ac-98993d0edea1';
71
92
$res = $export->exports->checkExport($uniqueId);
72
93
var_dump($res);
73
94
74
- ```
95
+ ````
75
96
76
97
Response
77
- ``` json
78
98
79
- [
80
- {
99
+ ``` json
100
+ {
101
+ "code" : 200 ,
102
+ "success" : true ,
103
+ "data" : {
81
104
"url" : " https://www.instagram.com/p/1234567" ,
82
- "datecreated" : " 2016-08-26T07:32:09+00:00" ,
83
- "uniqueId" : " dfd6a2f2-5579-421f-96ac-98993d0edea1" ,
84
- "done" : true ,
85
- "dateexported" : " 2016-08-26T07:32:27+00:00" ,
105
+ "guid" : " 2cfb0b9d-7633-4341-a702-cb889fe549eb" ,
106
+ "status" : " queueing" ,
107
+ "replies" : false ,
108
+ "fileName" : " comments5ea4b4d5a7602-1325511884314646.xlsx" ,
109
+ "fileNameRAW" : " 08b735760a5a40eb1fd70ca16e97aed3-2e0916fe-de86-4422-8449-fb608cbe5221.json" ,
110
+ "total" : 0 ,
111
+ "totalExported" : 0 ,
112
+ "retry" : 0 ,
86
113
"error" : null ,
87
- "total" : 306 ,
88
- "totalExported" : 306 ,
89
- "replies" : true ,
90
- "dateNotified" : null ,
91
114
"repliesCount" : 0 ,
92
- "downloadUrl" : " /exports/comments5d638af93ab70-1234567.xlsx" ,
93
- "rawUrl" : " /exports/6dbf1a87e0fb1f7f16b25be55bb37647-148d4d42-9db8-4e5a-9b51-a860e3646cb0.json"
94
- }
95
- ]
96
-
115
+ "twitterType" : null ,
116
+ "timezone" : " UTC" ,
117
+ "createdAt" : " 2016-08-26T07:32:27+00:00" ,
118
+ "updatedAt" : " 2016-08-26T07:32:27+00:00" ,
119
+ "exportedAt" : " " ,
120
+ "downloadUrl" : " /exports/comments5ea4b4d5a7602-1325511884314646.xlsx" ,
121
+ "rawUrl" : " /exports/08b735760a5a40eb1fd70ca16e97aed3-2e0916fe-de86-4422-8449-fb608cbe5221.json"
122
+ },
123
+ "message" : null
124
+ }
97
125
```
98
126
99
127
Exports list
128
+
100
129
``` php
101
130
102
131
$res = $export->exports->listExports();
@@ -107,38 +136,34 @@ var_dump($res);
107
136
Response
108
137
109
138
``` json
110
-
111
139
[
112
140
{
113
141
"url" : String,
114
- "datecreated " : Date,
115
- "uniqueId " : Uuid,
116
- "done " : Bool ,
117
- "dateexported " : Date,
142
+ "createdAt " : Date,
143
+ "guid " : Uuid,
144
+ "status " : String ,
145
+ "exportedAt " : Date,
118
146
"error" : String,
119
147
"total" : Int,
120
148
"totalExported" : Int,
121
149
"replies" : Bool,
122
- "dateNotified" : Date,
123
150
"repliesCount" : Int,
124
151
"downloadUrl" : String,
125
152
"rawUrl" : String
126
153
},
127
154
{
128
155
"url" : String,
129
- "datecreated " : Date,
130
- "uniqueId " : Uuid,
131
- "done " : Bool ,
132
- "dateexported " : Date,
156
+ "createdAt " : Date,
157
+ "guid " : Uuid,
158
+ "status " : String ,
159
+ "exportedAt " : Date,
133
160
"error" : String,
134
161
"total" : Int,
135
162
"totalExported" : Int,
136
163
"replies" : Bool,
137
- "dateNotified" : Date,
138
164
"repliesCount" : Int,
139
165
"downloadUrl" : String,
140
166
"rawUrl" : String
141
167
}
142
168
]
143
-
144
- ```
169
+ ```
0 commit comments