Skip to content

Commit 7e7c689

Browse files
committed
update extensionURL
1 parent 867b0e1 commit 7e7c689

File tree

4 files changed

+31
-10
lines changed

4 files changed

+31
-10
lines changed

README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
11
ChromePet
22
=========
33

4-
Report new extension version published on Chrome Web Store
4+
A node.js command line app for reporting new extension version published on Chrome Web Store
55

66
## Quick Start
7+
8+
```
9+
npm install -g chromepet
10+
11+
$ chromepet -u https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd -v 1.0.3
12+
```
13+
14+
#### Result
15+
```
16+
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
17+
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
18+
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
19+
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
20+
...
21+
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
22+
New version 1.0.3 is published! UserDownloads:9,823.
23+
Total seconds: 1.132
24+
```
25+
26+
## Module API
27+
728
```
829
npm install chromepet
930
```
@@ -14,7 +35,7 @@ This file `example/zenhub.js` is to check if a new version of ZenHub Chrome Exte
1435
var chromepet = require('chromepet');
1536

1637
chromepet({
17-
extensionURL: 'https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd/details',
38+
extensionURL: 'https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd',
1839
publishingVersion: '1.0.3'
1940
})
2041
.watch()
@@ -26,7 +47,7 @@ chromepet({
2647
});
2748
```
2849

29-
Result:
50+
#### Result
3051
```
3152
$ node example/zenhub.js
3253
Publishing version: 1.0.3; Published version: 1.0.2; Not published yet
@@ -55,7 +76,7 @@ var manifest = require(manifestPath);
5576
var publishingVersion = manifest.version;
5677

5778
chromepet({
58-
extensionURL: 'https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd/details',
79+
extensionURL: 'https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd',
5980
publishingVersion: publishingVersion,
6081
watchIntervalMS: 1000,
6182
})
@@ -79,4 +100,3 @@ chromepet({
79100

80101
## Contributors
81102
* [Leo Zhang](https://github.com/zhangchiqing)
82-

example/zenhub.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var manifest = require(manifestPath);
1111
var publishingVersion = manifest.version;
1212

1313
chromepet({
14-
extensionURL: 'https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd/details',
14+
extensionURL: 'https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd',
1515
publishingVersion: publishingVersion,
1616
watchIntervalMS: 1000,
1717
})

src/chromepet.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ var cheerio = require('cheerio');
66

77

88
var usage = function() {
9-
return 'extensionURL cannot be empty';
9+
return 'extensionURL cannot be empty. Example:\n' +
10+
'https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd';
1011
};
1112

1213

@@ -49,7 +50,7 @@ ChromePet.prototype.watch = function() {
4950
ChromePet.prototype._scrape = function() {
5051
var me = this;
5152

52-
request(this.options.extensionURL, function(err, response, body) {
53+
request(this.options.extensionURL + '/detail', function(err, response, body) {
5354
if (err) {
5455
return me.stopScraping(err);
5556
}

test/zenhub.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('chromepet', function() {
88
this.timeout(5000);
99
var counter = 0;
1010
var pet = chromepet({
11-
extensionURL: 'https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd/details',
11+
extensionURL: 'https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd',
1212
publishingVersion: '0.0.1',
1313
watchIntervalMS: 1000,
1414
});
@@ -29,7 +29,7 @@ describe('chromepet', function() {
2929

3030
it('should stop scraping when new version is published', function(done) {
3131
chromepet({
32-
extensionURL: 'https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd/details',
32+
extensionURL: 'https://chrome.google.com/webstore/detail/zenhub-for-github/ogcgkffhplmphkaahpmffcafajaocjbd',
3333
publishingVersion: publishingVersion,
3434
watchIntervalMS: 1000,
3535
})

0 commit comments

Comments
 (0)