Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
btk5h committed Dec 4, 2016
0 parents commit 198f377
Show file tree
Hide file tree
Showing 25 changed files with 1,828 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.java]
continuation_indent_size = 4
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## OSX
*.DS_Store

## Gradle
.gradle
build/

## IntelliJ
.idea/
*.iml
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 Bryan Terce

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
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.
176 changes: 176 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
# Reqn
> Pronounced `/ˈɹɛkən/`, like "reckon".
Reqn is an HTTP request library for Skript 2.X.

## Syntax

### Effect `Send Web Request`

Submits an HTTP request to the given URL. This

#### Syntax

`send [a[n]] [http] [%method%] [web] request to [the] [url] %url% [with ([the] headers
%headers% [and [the] body %body%]|[the] body %body% [and [the] headers %headers%])]`

*The last part of the syntax simply allows the header and body to be written in either order
(e.g. `with the headers and the body` or `with the body and the headers`)*

#### Parameters

- `method` (type `text`) - The HTTP method to use to send the request.
If omitted, defaults to `"get"`.
- `url` (type `text`) - The URL to send the request to.
- `headers` (type `texts`) - One or more headers in the format `"Header-Name: Value"` to be sent
in the request header.
- `body` (type `texts`) - Additional data to be sent in the body of the request. Multiple texts
are joined with new lines. This cannot be sent if the request uses the `"get"` method.

---

### Expression `Last Response` => `httpresponse`

Returns a custom `httpresponse` object that contains information from the last completed http
request.

#### Syntax

`[the] [last[ly]] [received] [http] [web] response`

---

### Expression `Response Code` => `number`

Returns the status codes of one or more `httpresponses`.

#### Syntax

`[the] [response] [status] code[s] of %httpresponses%`
or
`%httpresponses%'[s] [response] [status] code[s]`

---

### Expression `Response Message` => `text`

Returns the status messages of one or more `httpresponses`.

#### Syntax

`[the] [response] [status] (message|reason)[s] of %httpresponses%`
or
`%httpresponses%'[s] [response] [status] (message|reason)[s]`

---

### Expression `Response Status` => `text`

Returns the status lines of one or more `httpresponses`.

#### Syntax

`[the] [response] status[(es| line[s])] of %httpresponses%`
or
`%httpresponses%'[s] [response] status[(es| line[s])]`

---

### Expression `Response Headers` => `texts`

Returns the headers of one or more `httpresponses` in the format `"Header-Name: Value"`.

Multiple `httpresponses` may be passed to this expression, but the resulting headers will be
combined into a single list with no way to associate each header with its original `httpresponse`.

#### Syntax

`[the] [response] header[s] of %httpresponses%`
or
`%httpresponses%'[s] [response] header[s]`

---

### Expression `Response Header Keys` => `texts`

Returns the header keys (names) of one or more `httpresponses`. This expression is best used in
conjunction with `Response Header Values`

Multiple `httpresponses` may be passed to this expression, but the resulting keys will be
combined into a single list with no way to associate each key with its original `httpresponse`.

#### Syntax

`[the] [response] header key[s] of %httpresponses%`
or
`%httpresponses%'[s] [response] header key[s]`

---

### Expression `Response Header Values` => `texts`

Returns the header values of one or more `httpresponses`. This expression is best used in
conjunction with `Response Header Keys`

Multiple `httpresponses` may be passed to this expression, but the resulting values will be
combined into a single list with no way to associate each value with its original `httpresponse`.

#### Syntax

`[the] [response] header key[s] of %httpresponses%`
or
`%httpresponses%'[s] [response] header key[s]`

---

### Expression `Specific Response Header Value` => `text`

Returns the values of a specific header for one or more `httpresponses`.

Multiple `httpresponses` may be passed to this expression, but the resulting values will be
combined into a single list with no way to associate each value with its original `httpresponse`.

#### Syntax

`[the] %header% [response] header[ value][s] of %httpresponses%`
or
`%httpresponses%'[s] %header% [response] header[ value][s]`

#### Parameters

- `header` (type `text`) - The name of the header to return.

---

### Expression `Response Body` => `text`

Returns the bodies of one or more `httpresponses`.

#### Syntax

`[the] [response] bod(y|ies) of %httpresponses%`
or
`%httpresponses%'[s] [response] bod(y|ies)`

---

### Expression `URL Safe Text` => `text`

Converts a text into a text safe for usage in URLs. This can be useful for injecting user input
into a URL (e.g. when using a search api).

#### Syntax

`(http|ur(i|l)) (safe|encoded) %input%`

#### Parameters

- `input` (type `texts`) - One or more input texts to encode.

---

## Contributing

Feel free to submit pull requests, just make sure your changes are consistent with
[Google's Java code style](https://google.github.io/styleguide/javaguide.html)!

49 changes: 49 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* MIT License
*
* Copyright (c) 2016 Bryan Terce
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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.
*
*/

group 'com.w00tmast3r'
version '1.0.0'

apply plugin: 'java'

sourceCompatibility = 1.8

repositories {
mavenCentral()
maven {
url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
maven {
url 'https://oss.sonatype.org/content/groups/public/'
}
maven {
url 'http://maven.njol.ch/repo/'
}
}

dependencies {
compile 'org.spigotmc:spigot-api:1.11-R0.1-SNAPSHOT'
compile 'ch.njol:skript:2.2-SNAPSHOT'
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
31 changes: 31 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# MIT License
#
# Copyright (c) 2016 Bryan Terce
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# 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.
#
#

#Sat Dec 03 18:39:35 PST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-all.zip
Loading

0 comments on commit 198f377

Please sign in to comment.