Skip to content

Commit

Permalink
0.0.1
Browse files Browse the repository at this point in the history
Co-Authored-By: iTsSobhan <99456259+iTsSobhan@users.noreply.github.com>
  • Loading branch information
Sobhan-SRZA and iTsSobhan committed Aug 9, 2024
1 parent abc4e5d commit bc8cf43
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Sobhan-SRZA (mr.sinre) & Persian Caesar
Copyright (c) 2024 Sobhan-SRZA (mr.sinre) & Persian Caesar

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ The aparat website services in one package free to use and more quality.
An example to how catch user information like followers count and etc:
```js
const { API } = require("aparat.js");

const api = new API();

(async () => {

// User information results.
Expand Down
6 changes: 5 additions & 1 deletion src/components/error.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export class error extends Error {
this.name = "aparat.js"
constructor(message: string) {
super();
this.name = "aparat.js";
this.message = message;
}
}
30 changes: 15 additions & 15 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { User } from "./components/user";
import { Video } from "./components/video";
import { EventEmitter } from 'events';
export = {
/**
* @class
Expand All @@ -14,9 +13,10 @@ export = {
* const api = new API();
* ```
*/
API: class API extends EventEmitter {
API: class API {
user: User;
video: Video;
constructor() {
super();
this.user = new User();
this.video = new Video();
};
Expand All @@ -38,18 +38,18 @@ export = {
* });
* ```
*/
checkStream(username: string) {
let user;
let name = "streamStart";
this.once(name, async () => {
user = await this.user.search(username);
if (user.live.is_live) {
this.emit(name, user);
return user;
};
});
this.emit(name, user);
}
// checkStream(username: string) {
// let user;
// let name = "streamStart";
// this.once(name, async () => {
// user = await this.user.search(username);
// if (user.live.is_live) {
// this.emit(name, user);
// return user;
// };
// });
// this.emit(name, user);
// }
}
};
/**
Expand Down

0 comments on commit bc8cf43

Please sign in to comment.