forked from keybase/proofs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_scraper.iced
49 lines (35 loc) · 1.63 KB
/
test_scraper.iced
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
TwitterScraper = require './src/twitter_scraper.iced'
# -------------------------------------------------------------------------------------------------
scraper = new TwitterScraper()
# -------------------------------------------------------------------------------------------------
console.log "Testing direct lookup."
await scraper.check_status "malgorithms", "400699000954699777", "bitcoin", defer err
if err?
console.log "Error: #{err}"
# -------------------------------------------------------------------------------------------------
console.log "Testing hunt method."
await scraper.hunt "malgorithms", "Beer", defer err, tweet_id
if err?
console.log "Error: #{err}"
else
console.log " -- Testing found post."
await scraper.check_status "malgorithms", tweet_id, "Beer", defer err
if err?
console.log "Error: #{err}"
# -------------------------------------------------------------------------------------------------
console.log "Testing bad case on username."
await scraper.hunt "MALGORITHMS", "Beer", defer err, tweet_id
if err?
console.log "Error: #{err}"
else
console.log " -- Testing found post."
await scraper.check_status "MALGORITHMS", tweet_id, "Beer", defer err
if err?
console.log "Error: #{err}"
console.log "Testing protected user."
await scraper.hunt "foo", "Beer", defer err, tweet_id
console.log "Response: #{err}, #{tweet_id}"
# -------------------------------------------------------------------------------------------------
console.log "Testing hunting for shit which doesn't exist."
await scraper.hunt "malgorithms", "BOOYEAH WHOO HAH.", defer err, tweet_id
console.log "Response: #{err}, #{tweet_id}"