https://github.com/tchenu/yeswehack-sdk
YesWeHack SDK written in Deno 🦕
https://github.com/tchenu/yeswehack-sdk
deno sdk-deno yeswehack
Last synced: about 1 month ago
JSON representation
YesWeHack SDK written in Deno 🦕
- Host: GitHub
- URL: https://github.com/tchenu/yeswehack-sdk
- Owner: tchenu
- Created: 2020-06-19T08:22:02.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-21T19:05:59.000Z (about 5 years ago)
- Last Synced: 2025-07-05T02:30:45.836Z (12 months ago)
- Topics: deno, sdk-deno, yeswehack
- Language: TypeScript
- Homepage: https://yeswehack.com
- Size: 11.7 KB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# YesWeHack SDK 🧰
[YesWeHack](https://yeswehack.com) SDK written in Deno 🦕
*This SDK has been written for personal needs, if you want to improve it you can submit PRs.*
## Usage 👨🏼🔬
### Login 🚪
```typescript
import { YWH } from "https://deno.land/x/yeswehack/mod.ts";
const ywh = new YWH();
await ywh
.login('{LOGIN}', '{PASSWORD}')
.catch((error) => {
console.log(error);
});
```
### Login (TOTP) 🚪 + 🔑
```typescript
import { YWH } from "https://deno.land/x/yeswehack/mod.ts";
const ywh = new YWH();
await ywh
.login('{LOGIN}', '{PASSWORD}')
.then(async () => await ywh.totp('{TOTP_CODE}'))
.catch((error) => {
console.log(error);
});
```
### Hacktivity ⚡️
```typescript
import { YWH } from "https://deno.land/x/yeswehack/mod.ts";
const ywh = new YWH();
await ywh
.login('{LOGIN}', '{PASSWORD}')
.catch((error) => {
console.log(error);
});
const hacks = await ywh.hacktivityPerPage(1); // retrieve first page of hacktivity
hacks.map((hack: any) => {
console.log(hack.report.hunter.username);
});
```
### Reports 📄
```typescript
import { YWH } from "https://deno.land/x/yeswehack/mod.ts";
const ywh = new YWH();
await ywh
.login('{LOGIN}', '{PASSWORD}')
.catch((error) => {
console.log(error);
});
const reports = await ywh.reports();
reports.map((report: any) => {
console.log(report.title);
});
```
### Programs 🗂
```typescript
import { YWH } from "https://deno.land/x/yeswehack/mod.ts";
const ywh = new YWH();
await ywh
.login('{LOGIN}', '{PASSWORD}')
.catch((error) => {
console.log(error);
});
const programs = await ywh.programs();
programs.map((program: any) => {
console.log(program.title);
});
```
## User (current) 👨🏻💼
```typescript
import { YWH } from "https://deno.land/x/yeswehack/mod.ts";
const ywh = new YWH();
await ywh
.login('{LOGIN}', '{PASSWORD}')
.catch((error) => {
console.log(error);
});
const user = await ywh.user();
console.log(`Log as ${user.username}`);
```
### User (with username) 👨
```typescript
import { YWH } from "https://deno.land/x/yeswehack/mod.ts";
const ywh = new YWH();
await ywh
.login('{LOGIN}', '{PASSWORD}')
.catch((error) => {
console.log(error);
});
const hunter = await ywh.user('BZHugs');
console.log(hunter);
```
## Todos 📌
- Use interfaces for response objects (reports, hacks, hunter etc.) instead of using `any`.
- Add some methods (submit reports, update current user etc.)