Skip to content

Commit ed62879

Browse files
committed
first version
1 parent 0297ae2 commit ed62879

File tree

9 files changed

+435
-2
lines changed

9 files changed

+435
-2
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/bower_components
2+
/.idea/
3+
/.codekit-cache/
4+
/config.codekit
5+
/node_modules

Gruntfile.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module.exports = function(grunt) {
2+
3+
grunt.initConfig({
4+
pkg: grunt.file.readJSON('package.json'),
5+
uglify: {
6+
js: {
7+
files : {
8+
'dist/angular-vimeo-api-factory.min.js' : ['src/angular-vimeo-api-factory.js']
9+
}
10+
},
11+
options: {
12+
banner: '\n/*! <%= pkg.name %> v<%= pkg.version %> (<%= grunt.template.today("dd-mm-yyyy") %>) by <%= pkg.author %> */\n',
13+
}
14+
},
15+
watch: {
16+
minifiyJs: {
17+
files: [
18+
'src/angular-vimeo-api-factory.js'
19+
],
20+
tasks: ['uglify'],
21+
options: {
22+
spawn: true,
23+
},
24+
},
25+
},
26+
});
27+
28+
grunt.loadNpmTasks('grunt-contrib-uglify');
29+
grunt.loadNpmTasks('grunt-contrib-watch');
30+
31+
grunt.registerTask('default', ['watch']);
32+
33+
};

README.md

Lines changed: 111 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,111 @@
1-
# angular-vimeo-api-factory
2-
AngularJS factory for Vimeo JSON REST API requests
1+
**angular-vimeo-api-factory** is an angularjs module with a vimeo api factory.
2+
3+
Author: Jonathan Hornung ([JohnnyTheTank](https://github.com/JohnnyTheTank))
4+
5+
## Usage
6+
7+
1. Install via [bower](http://bower.io/) :
8+
1. `bower install --save angular-vimeo-api-factory`
9+
2. Add `jtt_vimeo` to your application's module dependencies.
10+
3. Include dependencies in your HTML.
11+
1. When using bower:
12+
13+
```html
14+
<script src="bower_components/angular/angular.js"></script>
15+
<script src="bower_components/angular-vimeo-api-factory/src/angular-vimeo-api-factory.js"></script>
16+
```
17+
18+
4. Use the factory `vimeoFactory`.
19+
20+
21+
### factory methods
22+
23+
#### getVideos
24+
25+
##### getVideosFromChannel
26+
```js
27+
// parameters: https://developer.vimeo.com/api/endpoints/channels#/{channel_id}/videos
28+
vimeoFactory.getVideosFromChannel({
29+
channel:"<CHANNEL_NAME>",
30+
per_page:"<ITEMS_PER_PAGE>", // (optional) default: 20
31+
page:"<PAGE_NUMBER>", // (optional)
32+
query:"<QUERY>", // (optional)
33+
filter:"<FILTER>", // (optional)
34+
filter_embeddable:"<FILTER_EMBEDDABLE>", // (optional)
35+
sort:"<SORT>", // (optional)
36+
direction:"<DIRECTION>", // (optional)
37+
access_token:"<ACCESS_TOKEN>"
38+
}).success(function(_data){
39+
//on success
40+
}).error(function (_data) {
41+
//on error
42+
});
43+
```
44+
45+
##### getVideosFromUser
46+
```js
47+
// parameters: https://developer.vimeo.com/api/endpoints/users#/{user_id}/videos
48+
vimeoFactory.getVideosFromUser({
49+
user:"<USER_NAME>",
50+
per_page:"<ITEMS_PER_PAGE>", // (optional) default: 20
51+
page:"<PAGE_NUMBER>", // (optional)
52+
query:"<QUERY>", // (optional)
53+
filter:"<FILTER>", // (optional)
54+
filter_embeddable:"<FILTER_EMBEDDABLE>", // (optional)
55+
sort:"<SORT>", // (optional)
56+
direction:"<DIRECTION>", // (optional)
57+
access_token:"<ACCESS_TOKEN>"
58+
}).success(function(_data){
59+
//on success
60+
}).error(function (_data) {
61+
//on error
62+
});
63+
```
64+
65+
##### getVideosFromCategory
66+
```js
67+
// parameters: https://developer.vimeo.com/api/endpoints/categories#/{category}/videos
68+
vimeoFactory.getVideosFromCategory({
69+
category:"<CATEGORY_NAME>",
70+
per_page:"<ITEMS_PER_PAGE>", // (optional) default: 20
71+
page:"<PAGE_NUMBER>", // (optional)
72+
query:"<QUERY>", // (optional)
73+
filter:"<FILTER>", // (optional)
74+
filter_embeddable:"<FILTER_EMBEDDABLE>", // (optional)
75+
sort:"<SORT>", // (optional)
76+
direction:"<DIRECTION>", // (optional)
77+
access_token:"<ACCESS_TOKEN>"
78+
}).success(function(_data){
79+
//on success
80+
}).error(function (_data) {
81+
//on error
82+
});
83+
```
84+
85+
##### getVideosFromTag
86+
```js
87+
// parameters: https://developer.vimeo.com/api/endpoints/tags#/{word}/videos
88+
vimeoFactory.getVideosFromTag({
89+
tag:"<CATEGORY_NAME>",
90+
per_page:"<ITEMS_PER_PAGE>", // (optional) default: 20
91+
page:"<PAGE_NUMBER>", // (optional)
92+
query:"<QUERY>", // (optional)
93+
sort:"<SORT>", // (optional)
94+
direction:"<DIRECTION>", // (optional)
95+
access_token:"<ACCESS_TOKEN>"
96+
}).success(function(_data){
97+
//on success
98+
}).error(function (_data) {
99+
//on error
100+
});
101+
```
102+
103+
## Vimeo Graph JSON API
104+
105+
* docs: https://developer.vimeo.com/api/endpoints/
106+
* api playground: https://developer.vimeo.com/api/playground/
107+
108+
109+
## License
110+
111+
MIT

bower.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "angular-vimeo-api-factory",
3+
"description": "angularjs factory for vimeo json rest api requests",
4+
"version": "0.1.0",
5+
"main": "Gruntfile.js",
6+
"authors": [
7+
"Jonathan Hornung"
8+
],
9+
"license": "MIT",
10+
"keywords": [
11+
"angularjs",
12+
"angular",
13+
"vimeo",
14+
"api",
15+
"factory"
16+
],
17+
"homepage": "https://github.com/JohnnyTheTank/angular-vimeo-api-factory",
18+
"moduleType": [
19+
"globals"
20+
],
21+
"ignore": [
22+
"**/.*",
23+
"node_modules",
24+
"bower_components",
25+
"test",
26+
"tests"
27+
],
28+
"dependencies": {
29+
"angular": "*"
30+
}
31+
}

demo/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!doctype html>
2+
<html lang="de">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>angular-vimeo-api-factory</title>
6+
7+
<script src="../bower_components/angular/angular.min.js"></script>
8+
<script src="js/app.js"></script>
9+
<script src="../src/angular-vimeo-api-factory.js"></script>
10+
11+
</head>
12+
<body ng-app="app">
13+
<div ng-controller="controller">
14+
Look in your console
15+
</div>
16+
17+
</body>
18+
</html>

demo/js/app.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
var app = angular.module("app", ['jtt_vimeo']);
2+
app.controller('controller', ['$scope', 'vimeoFactory', function($scope, vimeoFactory) {
3+
4+
var _acces_token = "<YOUR_VIMEO_ACCESS_TOKEN>";
5+
6+
vimeoFactory.getVideosFromChannel({
7+
channel:"nicetype",
8+
per_page:2,
9+
access_token:_acces_token
10+
}).success(function(_data){
11+
console.log("videos from channel");
12+
console.log(_data);
13+
});
14+
15+
vimeoFactory.getVideosFromCategory({
16+
category:"cameratechniques",
17+
per_page:2,
18+
access_token:_acces_token
19+
}).success(function(_data){
20+
console.log("videos from category");
21+
console.log(_data);
22+
});
23+
24+
vimeoFactory.getVideosFromTag({
25+
tag:"fcbayern",
26+
per_page:2,
27+
access_token:_acces_token
28+
}).success(function(_data){
29+
console.log("videos from tag");
30+
console.log(_data);
31+
});
32+
33+
vimeoFactory.getVideosFromUser({
34+
user:"alexanderengel",
35+
per_page:2,
36+
access_token:_acces_token
37+
}).success(function(_data){
38+
console.log("videos from user");
39+
console.log(_data);
40+
});
41+
42+
}]);

dist/angular-vimeo-api-factory.min.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "angular-vimeo-api-factory",
3+
"version": "0.1.0",
4+
"description": "angularjs factory for vimeo json rest api requests",
5+
"main": "Gruntfile.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/JohnnyTheTank/angular-vimeo-api-factory.git"
12+
},
13+
"keywords": [
14+
"angularjs",
15+
"angular",
16+
"vimeo",
17+
"api",
18+
"factory"
19+
],
20+
"author": "Jonathan Hornung",
21+
"license": "MIT",
22+
"bugs": {
23+
"url": "https://github.com/JohnnyTheTank/angular-vimeo-api-factory/issues"
24+
},
25+
"homepage": "https://github.com/JohnnyTheTank/angular-vimeo-api-factory#readme",
26+
"devDependencies": {
27+
"grunt": "^0.4.5",
28+
"grunt-contrib-uglify": "^0.11.0",
29+
"grunt-contrib-watch": "^0.6.1"
30+
}
31+
}

0 commit comments

Comments
 (0)