Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 3341b3b

Browse files
authored
Update README.md
1 parent 4138f1e commit 3341b3b

File tree

1 file changed

+46
-21
lines changed

1 file changed

+46
-21
lines changed

README.md

Lines changed: 46 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -91,65 +91,90 @@ If you have not already download npm:
9191

9292
### Installation
9393

94-
1. Install the latest version
94+
1. Install the latest version of the package
9595
```sh
9696
$ npm install replapi-it
9797
```
98-
2. Require the package
98+
2. Require the package in your code
9999
```js
100100
const repl = require('replapi-it');
101101
```
102102

103103
## Usage
104104

105-
Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.
105+
Using ReplAPI.it is very simple! Let's create a simple user and ask for their cycles:
106+
```js
107+
const repl = require('replapi-it');
108+
109+
const myUser = new repl.User("RayhanADev");
110+
111+
async function getCycles() {
112+
let info = await myUser.profileData();
113+
let cycles = info.cycles;
114+
console.log(`User Cycles: ${cycles}`)
115+
}
116+
117+
getCycles()
118+
```
119+
120+
Output:
121+
```sh
122+
User Cycles: 1008
123+
```
124+
125+
126+
That was fun! Now how about getting a specific post? Let's create a simple post and ask for it's body:
127+
```js
128+
const repl = require('replapi-it');
129+
130+
const myPost = new repl.Post(78043);
131+
132+
async function getTitle() {
133+
let info = await myPost.postData();
134+
let title = info.title;
135+
console.log(`Post Title: ${title}`)
136+
}
137+
138+
getTitle()
139+
```
140+
Output:
141+
```sh
142+
Post Title: Presenting... 🤔 RayhanADev 🤔? (GraphQL Success!)
143+
```
106144

107145
_For more examples, please refer to the [Documentation](https://replapidocs.rayhanadev.repl.co/)_
108146

109-
110-
111-
<!-- ROADMAP -->
112147
## Roadmap
113148

114149
See the [open issues](https://github.com/RayhanADev/REPLAPI.it/issues) for a list of proposed features (and known issues).
115150

151+
I'm considering adding in support for Crosis communications after they distribute developer keys again. Right now I'm experimenting with WSS and eval.repl.it for code execution!
116152

117-
118-
<!-- CONTRIBUTING -->
119153
## Contributing
120154

121-
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
155+
Contributions are **much appreciated**, and if you know another query that should be implemented on this package, follow these steps!
122156

123157
1. Fork the Project
124158
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
125159
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
126160
4. Push to the Branch (`git push origin feature/AmazingFeature`)
127161
5. Open a Pull Request
128162

129-
130-
131-
<!-- LICENSE -->
132163
## License
133164

134165
Distributed under the GPL-3.0 License. See `LICENSE` for more information.
135166

136-
137-
138-
<!-- CONTACT -->
139167
## Contact
140168

141169
RayhanADev - [@RayhanADev](https://repl.it/@RayhanADev) - rayhan.arayilakath@wa-students.org
142170

143171
Project Link: [https://github.com/RayhanADev/REPLAPI.it](https://github.com/RayhanADev/REPLAPI.it)
144172

145-
146-
147-
<!-- ACKNOWLEDGEMENTS -->
148173
## Acknowledgements
149174

150-
* []()
151-
* []()
152-
* []()
175+
* [cursorweb](https://github.com/cursorweb) aka [mrlapizgithub](https://github.com/mrlapizgithub) for several dozen GraphQL queries
176+
* [kognise](https://github.com/kognise) for open-sourcing eval.repl.it's usage
177+
* [mat-1](https://github.com/mat-1) for their original Repl.it API package
153178

154179

155180

0 commit comments

Comments
 (0)