Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 1efd148

Browse files
committed
Add trigger
1 parent 84a48ad commit 1efd148

File tree

3 files changed

+117
-3
lines changed

3 files changed

+117
-3
lines changed

index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const LikeTrigger = require('./triggers/like');
12
const authentication = require('./authentication');
23

34
// We can roll up all our behaviors in an App.
@@ -18,7 +19,9 @@ const App = {
1819
resources: {},
1920

2021
// If you want your trigger to show up, you better include it here!
21-
triggers: {},
22+
triggers: {
23+
[LikeTrigger.key]: LikeTrigger
24+
},
2225

2326
// If you want your searches to show up, you better include it here!
2427
searches: {},

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"npm": ">=5.6.0"
1616
},
1717
"dependencies": {
18-
"zapier-platform-schema": "7.4.0",
19-
"zapier-platform-core": "7.4.0"
18+
"zapier-platform-core": "7.4.0",
19+
"zapier-platform-schema": "7.4.0"
2020
},
2121
"devDependencies": {
2222
"mocha": "^5.2.0",

triggers/like.js

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
module.exports = {
2+
key: 'like',
3+
noun: 'Like',
4+
5+
display: {
6+
label: 'New Like',
7+
description: 'Triggers when you like a tweet.'
8+
},
9+
10+
operation: {
11+
perform: {
12+
url: 'https://api.twitter.com/1.1/favorites/list.json'
13+
},
14+
sample: {
15+
coordinates: null,
16+
truncated: false,
17+
favorited: true,
18+
created_at: 'Tue Sep 04 15:55:52 +0000 2012',
19+
id_str: '243014525132091393',
20+
in_reply_to_user_id_str: null,
21+
entities: {
22+
urls: [],
23+
hashtags: [],
24+
user_mentions: []
25+
},
26+
text:
27+
"Note to self: don't die during off-peak hours on a holiday weekend.",
28+
contributors: null,
29+
id: 243014525132091400,
30+
retweet_count: 0,
31+
in_reply_to_status_id_str: null,
32+
geo: null,
33+
retweeted: false,
34+
in_reply_to_user_id: null,
35+
in_reply_to_screen_name: null,
36+
source: 'web',
37+
user: {
38+
profile_sidebar_fill_color: '252429',
39+
profile_background_tile: true,
40+
profile_sidebar_border_color: '181A1E',
41+
name: 'Sean Cook',
42+
profile_image_url:
43+
'http://a0.twimg.com/profile_images/1751506047/dead_sexy_normal.JPG',
44+
location: 'San Francisco',
45+
created_at: 'Sat May 09 17:58:22 +0000 2009',
46+
follow_request_sent: false,
47+
is_translator: false,
48+
id_str: '38895958',
49+
profile_link_color: '2FC2EF',
50+
entities: {
51+
description: {
52+
urls: []
53+
}
54+
},
55+
favourites_count: 594,
56+
url: null,
57+
default_profile: false,
58+
contributors_enabled: true,
59+
profile_image_url_https:
60+
'https://si0.twimg.com/profile_images/1751506047/dead_sexy_normal.JPG',
61+
utc_offset: -28800,
62+
id: 38895958,
63+
listed_count: 191,
64+
profile_use_background_image: true,
65+
followers_count: 10659,
66+
protected: false,
67+
profile_text_color: '666666',
68+
lang: 'en',
69+
profile_background_color: '1A1B1F',
70+
time_zone: 'Pacific Time (US & Canada)',
71+
verified: false,
72+
profile_background_image_url_https:
73+
'https://si0.twimg.com/profile_background_images/495742332/purty_wood.png',
74+
description:
75+
'I taught your phone that thing you like. The Mobile Partner Engineer @Twitter. ',
76+
geo_enabled: true,
77+
notifications: false,
78+
default_profile_image: false,
79+
friends_count: 1186,
80+
profile_background_image_url:
81+
'http://a0.twimg.com/profile_background_images/495742332/purty_wood.png',
82+
statuses_count: 2629,
83+
following: true,
84+
screen_name: 'theSeanCook',
85+
show_all_inline_media: true
86+
},
87+
place: {
88+
name: 'San Francisco',
89+
country_code: 'US',
90+
country: 'United States',
91+
attributes: {},
92+
url: 'http://api.twitter.com/1/geo/id/5a110d312052166f.json',
93+
id: '5a110d312052166f',
94+
bounding_box: {
95+
coordinates: [
96+
[
97+
[-122.51368188, 37.70813196],
98+
[-122.35845384, 37.70813196],
99+
[-122.35845384, 37.83245301],
100+
[-122.51368188, 37.83245301]
101+
]
102+
],
103+
type: 'Polygon'
104+
},
105+
full_name: 'San Francisco, CA',
106+
place_type: 'city'
107+
},
108+
in_reply_to_status_id: null
109+
}
110+
}
111+
};

0 commit comments

Comments
 (0)