@@ -19,8 +19,9 @@ var gmail = Gmail();
19
19
20
20
## Methods
21
21
22
+ ### Summary
22
23
23
- ### GET
24
+ #### GET
24
25
25
26
26
27
- gmail.get ** .visible_emails()**
@@ -29,7 +30,6 @@ var gmail = Gmail();
29
30
- gmail.get ** .storage_info()**
30
31
- gmail.get ** .current_page()**
31
32
- gmail.get ** .email_subject()**
32
- - gmail.get ** .email_ids()**
33
33
- gmail.get ** .email_id()**
34
34
- gmail.get ** .search_query()**
35
35
- gmail.get ** .unread_emails()**
@@ -46,7 +46,7 @@ var gmail = Gmail();
46
46
47
47
48
48
49
- ### CHECK
49
+ #### CHECK
50
50
51
51
52
52
- gmail.check ** .is_thread()**
@@ -66,7 +66,7 @@ var gmail = Gmail();
66
66
- gmail.check ** .is_signal_installed()**
67
67
68
68
69
- ### OBSERVE
69
+ #### OBSERVE
70
70
71
71
- gmail.observe ** .http_requests()**
72
72
- gmail.observe ** .actions()**
@@ -101,7 +101,7 @@ var gmail = Gmail();
101
101
- gmail.observe ** .off(action)**
102
102
103
103
104
- ### DOM
104
+ #### DOM
105
105
106
106
107
107
- gmail.dom ** .inbox_content()**
@@ -112,7 +112,7 @@ var gmail = Gmail();
112
112
- gmail.dom ** .search_bar()**
113
113
114
114
115
- ### TOOLS
115
+ #### TOOLS
116
116
117
117
- gmail.tools ** .xhr_watcher()**
118
118
- gmail.tools ** .parse_url()**
@@ -122,7 +122,7 @@ var gmail = Gmail();
122
122
- gmail.tools ** .make_request()**
123
123
124
124
125
- ### TRACKER
125
+ #### TRACKER
126
126
127
127
- gmail.tracker ** .events**
128
128
- gmail.tracker ** .xhr_init**
@@ -133,3 +133,166 @@ var gmail = Gmail();
133
133
- gmail.tracker ** .email_data**
134
134
- gmail.tracker ** .ik**
135
135
- gmail.tracker ** .rid**
136
+
137
+
138
+
139
+ ### Details
140
+
141
+
142
+ #### gmail.get.visible_emails()
143
+
144
+ Returns a list of emails from the server that are currently visible in the inbox view. The data does not come from the DOM
145
+
146
+ ``` json
147
+ [{"id" : " 1425a3693a4c45d0" ,
148
+ "title" : " <b>What if video games were real? On YouTube</b>" ,
149
+ "excerpt" : " View email in a web browser Header Super Mario Brothers Parkour by Warialasky Super Mario Brothers" ,
150
+ "time" : " Fri, Nov 15, 2013 at 12:23 AM" ,
151
+ "sender" : " noreply@youtube.com" ,
152
+ "attachment" : " " ,
153
+ "labels" : [" ^all" , " ^i" , " ^smartlabel_social" , " ^unsub" ]}]
154
+ ```
155
+
156
+ #### gmail.get.email_data()
157
+
158
+ Returns an object representation of the opened email contents and metadata
159
+
160
+ ``` json
161
+ {
162
+ "first_email" : " 141d44da39d6caf8" ,
163
+ "last_email" : " 141d44da39d6caf8" ,
164
+ "total_emails" : 1 ,
165
+ "total_threads" : [" 141d44da39d6caf8" ],
166
+ "people_involved" : [
167
+ [" Kartik Talwar" , " hi@kartikt.com" ],
168
+ [" California" , " california@gmail.com" ]
169
+ ],
170
+ "subject" : " test" ,
171
+ "threads" : {
172
+ "141d44da39d6caf8" : {
173
+ "reply_to_id" : " " ,
174
+ "from" : " California" ,
175
+ "from_email" : " california@gmail.com" ,
176
+ "timestamp" : 1382246359000 ,
177
+ "datetime" : " Sun, Nov 20, 2013 at 1:19 AM" ,
178
+ "content_plain" : " another test" ,
179
+ "subject" : " test" ,
180
+ "content_html" : " <div dir=\" ltr\" >another test</div>\n "
181
+ }
182
+ }
183
+ }
184
+ ```
185
+
186
+ #### gmail.get.user_email()
187
+
188
+ Returns the current user's email address
189
+
190
+ ``` js
191
+ " california@gmail.com"
192
+ ```
193
+
194
+ #### gmail.get.storage_info()
195
+
196
+ Returns current user's file storage stats
197
+
198
+ ``` json
199
+ {
200
+ "used" : " 0 GB" ,
201
+ "total" : " 15 GB" ,
202
+ "percent" : 0
203
+ }
204
+ ```
205
+
206
+ #### gmail.get.current_page()
207
+
208
+ Returns what page of gmail the user is currently on. These are the possible responses
209
+
210
+ ``` js
211
+ [' sent' , ' inbox' , ' starred' , ' drafts' , ' imp' , ' chats' , ' all' , ' spam' , ' trash' ] // pages
212
+ null // inside email conversation
213
+ " /search/[.+]" // inside search view
214
+ " /label/[.+]" // inside label view
215
+ " /category/[.+]" // inside category view
216
+ ```
217
+
218
+ #### gmail.get.email_subject()
219
+
220
+ Returns the opened email's subject from the DOM
221
+
222
+ ``` js
223
+ " test"
224
+ ```
225
+
226
+
227
+ #### gmail.get.email_id()
228
+
229
+ Gets current email's ID
230
+
231
+ ``` js
232
+ " 141de25dc0b48e4f"
233
+ ```
234
+
235
+ #### gmail.get.search_query()
236
+
237
+ Returns the search bar data
238
+
239
+ ``` js
240
+ " from:hi@kartikt.com is:unread"
241
+ ```
242
+
243
+ #### gmail.get.unread_emails()
244
+
245
+ Returns a count of total unread emails for the current account.
246
+
247
+ ``` json
248
+ {
249
+ "inbox" : 2 ,
250
+ "drafts" : 0 ,
251
+ "spam" : 0 ,
252
+ "forum" : 0 ,
253
+ "notifications" : 0 ,
254
+ "promotions" : 0 ,
255
+ "social" : 0
256
+ }
257
+ ```
258
+
259
+ You can also request the data individually
260
+
261
+ - ** gmail.get.unread_inbox_emails()**
262
+ - ** gmail.get.unread_draft_emails()**
263
+ - ** gmail.get.unread_spam_emails()**
264
+ - ** gmail.get.unread_forum_emails()**
265
+ - ** gmail.get.unread_notification_emails()**
266
+ - ** gmail.get.unread_promotion_emails()**
267
+ - ** gmail.get.unread_social_emails()**
268
+
269
+
270
+ #### gmail.get.last_active()
271
+
272
+ Gets user's account activity data
273
+
274
+ ``` json
275
+ {
276
+ "time" : " 9:41 pm" ,
277
+ "ip" : " 54.234.192.48" ,
278
+ "mac_address" : " 2620:101:f000:702:a966:ab42:4a46:195e" ,
279
+ "time_relative" : " 31 minutes ago"
280
+ }
281
+ ```
282
+
283
+ #### gmail.get.loggedin_accounts()
284
+
285
+ Returns a list of signed-in accounts (multiple user accounts setup in gmail)
286
+
287
+ ``` json
288
+ [{"name" :" California" ,"email" :" california@gmail.com" }]
289
+ ```
290
+
291
+ #### gmail.get.beta()
292
+
293
+ Although hand picked, this method returns the checks on beta features and deployments
294
+
295
+ ``` json
296
+ {"new_nav_bar" :true }
297
+ ```
298
+
0 commit comments