diff --git a/htdocs/application/controllers/api.php b/htdocs/application/controllers/api.php index f6e6157..afe2be6 100644 --- a/htdocs/application/controllers/api.php +++ b/htdocs/application/controllers/api.php @@ -9,6 +9,7 @@ * - random() * - recent() * - trending() + * - langs() * Classes list: * - Api extends Main */ @@ -168,4 +169,10 @@ class Api extends Main } echo json_encode($data); } + + function langs() + { + $languages = $this->languages->get_languages(); + echo json_encode($languages); + } } diff --git a/htdocs/themes/bootstrap/views/api_help.php b/htdocs/themes/bootstrap/views/api_help.php index 28e0cc1..d2110fc 100644 --- a/htdocs/themes/bootstrap/views/api_help.php +++ b/htdocs/themes/bootstrap/views/api_help.php @@ -24,6 +24,9 @@
Create pastes from the commandline
+Create pastes from the commandline
-text=[your paste text]
- The paste content. Required.
+title=[title]
- Title for the paste.
+text=[your paste text]
+ The paste content. Required.
-name=[name]
- The author's name.
+title=[title]
+ Title for the paste.
-private=1
- Make paste private.
+name=[name]
+ The author's name.
-lang=[language]
-
- Use alternative syntax highlighting.
- Possible values:
-
private=1
+ Make paste private.
-expire=[minutes]
- Set paste expiration.
+lang=[language]
+
+ Use alternative syntax highlighting.
+ Possible values:
+
reply=[pasteid]
- Reply to existing paste.
+expire=[minutes]
+ Set paste expiration.
-
- On success, the API returns the paste URL:
- On error, the API returns the error message: Error: Missing paste text
-
reply=[pasteid]
+ Reply to existing paste.
-curl -d text='this is my text'
- Create a paste with the text 'this is my text'.
+
+ On success, the API returns the paste URL:
+ On error, the API returns the error message: Error: Missing paste text
+
curl -d private=1 -d name=Herbert --data-urlencode text@/etc/passwd
- Create a private paste with the author 'Herbert' and the contents of '/etc/passwd'.
+curl -d text='this is my text'
+ Create a paste with the text 'this is my text'.
-curl -d lang=php --data-urlencode text@main.php
- Create a paste with PHP syntax highlighting.
+curl -d private=1 -d name=Herbert --data-urlencode text@/etc/passwd
+ Create a private paste with the author 'Herbert' and the contents of '/etc/passwd'.
-curl
- Display paste.
+curl -d lang=php --data-urlencode text@main.php
+ Create a paste with PHP syntax highlighting.
+curl
+ Display paste.
+