Skip to content

Commit 4babf1d

Browse files
committed
Merge pull request #1 from pvorb/patch-1
Improve README
2 parents b722e5f + fdb7dc4 commit 4babf1d

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

README.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,41 @@ Usage
1010
- All api methods are available through subdb.api attributes (see http://thesubdb.com/api/ for methods and arguments).
1111
- A hash method helper is also available
1212

13-
```nodejs
13+
``` javascript
1414
subdb.computeHash(path_to_movie, callback);
1515
```
16-
17-
```js
1816
For searching a sub file
1917

20-
SubDb = require("subdb");
18+
``` javascript
19+
var SubDb = require("subdb");
2120

22-
var subdb = new SubDb();
23-
subdb.computeHash(path_to_movie, function(err, res) {
24-
if(err) return err;
21+
var subdb = new SubDb();
22+
subdb.computeHash(path_to_movie, function(err, res) {
23+
if(err) return err;
2524

26-
var hash = res;
27-
subdb.api.search_subtitles(hash, function(err, res){
25+
var hash = res;
26+
subdb.api.search_subtitles(hash, function(err, res){
2827

29-
if(err) return err;
30-
31-
subdb.api.download_subtitle(hash, res.join(','), 'pathtosub.srt', function(err, res) {
32-
if(err) return err;
28+
if(err) return err;
3329

34-
// sub is normally fetched into pathtosub.srt
35-
});
30+
subdb.api.download_subtitle(hash, res.join(','), 'pathtosub.srt', function(err, res) {
31+
if(err) return err;
3632

33+
// sub is normally fetched into pathtosub.srt
3734
});
35+
3836
});
37+
});
3938
```
4039
For uploading a sub file
4140

42-
```javascript
43-
SubDb = require("subdb");
41+
``` javascript
42+
var SubDb = require("subdb");
4443

45-
var subdb = new SubDb();
46-
subdb.api.upload_subtitle(hash, subfile, function(err, res){
47-
if(err) return err;
44+
var subdb = new SubDb();
45+
subdb.api.upload_subtitle(hash, subfile, function(err, res){
46+
if(err) return err;
4847

49-
// sub subfile is normally uploaded to thesubdb.com servers
50-
});
48+
// sub subfile is normally uploaded to thesubdb.com servers
49+
});
5150
```

0 commit comments

Comments
 (0)