Skip to content

Commit

Permalink
A fresh start
Browse files Browse the repository at this point in the history
  • Loading branch information
cadox8 committed Nov 3, 2021
1 parent 19fee61 commit 8786198
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5,958 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
102 changes: 11 additions & 91 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
![Logo](docs/img/logo.png)
![Logo](docs/img/logo_64.png)

[![Build Status](https://travis-ci.org/cadox8/XenAPI.svg?branch=master)](https://travis-ci.org/cadox8/XenAPI)

### This is a simple XenForo API for Java and PHP.
### This is a simple XenForo API for Java.
-----

## Summary
* [XenAPI for Xenforo 2.X](#me.cadox8.xenapi-for-xenforo-2x)
* [XenAPI for Xenforo 1.X](#me.cadox8.xenapi-for-xenforo-1x)
* [Downloads & Repo](#downloads--repo)
* [Documentation](#documentation)
* [Bug Reporting](#bug-reporting)
* [Contributing](#contributing)
* [Instalation](#installation)
* [Usage & API Key](#usage--api-key)
- [For PHP](#for-php)
- [For Java](#for-java)
* [Dependencies](#dependencies)
* [Bug Reporting](#bug-reporting)
* [License & Copyright](#license--copyright)
* [Donations](#donations)
* [TODO](#todo)
- [TODO Docs](#todo-docs)
* [TODO](https://github.com/cadox8/XenAPI/issues/15)
-----

## XenAPI for Xenforo 2.X
This repo contains the Java and the Web API for Xenforo 1.X.
## XenAPI for Xenforo 1.X
This repo contains only a framework for Xenforo 2.X.

A Java version for Xenforo 2.X is being developed, but I recommend you to use [this](https://xfrocks.com/resources/bd-api-for-xenforo-2-0.36/) for the WebAPI.
v1.X of Xenforo will not be developed anymore. If you need the old API you can grab it from [here](https://github.com/cadox8/XenAPI/releases/tag/Xenforo_v1.X).

## Downloads & Repo
All downloads are hosted in [Github](https://github.com/cadox8/XenAPI/releases).
Expand All @@ -37,13 +34,13 @@ For the Java-API, you can add it on Maven:
<repositories>
<repository>
<id>XenAPI Repo</id>
<url>https://cadox8.github.io/repo/</url>
<url>https://cadox8.es/repo</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>me.cadox8</groupId>
<groupId>es.cadox8</groupId>
<artifactId>XenAPI</artifactId>
<version>RELEASE</version>
</dependency>
Expand All @@ -64,32 +61,11 @@ You can create an issue here on GitHub to report a bug with the API or to sugges
If you want to contribute to the project, you must accept and follow our [Code Of Conduct](.github/CODE_OF_CONDUCT.md) and our [guides for contributing](.github/CONTRIBUTING.md).

## Instalation
The api.php goes in the root folder of the XenForo installation.

Then, you will need to [Set an API Key](#usage--api-key)

## Usage & API Key
You will need to enable API in your XenForo. You can use this [guide](https://xenforo.com/docs/dev/rest-api/).

**NOTE:** I recomend a Version 4 UUID for the API Key (really recomended). You can generate one [here](https://www.uuidgenerator.net).

### For PHP
To run change the API key by replace the ``me.cadox8.xenapi`` with your desired API key (UUID).
```javascript
$restAPI = new RestAPI('NEW_API_KEY');
```

or send hash in format: ``username:hash`` , where hash is result authenticate action.

### For Java
**You need to set the new API Key in PHP before doing this!**

```java
XenAPI api = new XenAPI("YOUR_API_KEY"); // Setted in api.php

XenAPI api = new XenAPI("YOUR_API_KEY", "YOUR_FORUM_URL"); // Setted in api.php / Must have http:// | https://
```

Then, you will use that Key in the program.

## Dependencies
The XenAPI (Java) has the following dependencies:
Expand All @@ -106,63 +82,7 @@ Cadox8 updated the code and created the Java API.

[Contex](https://github.com/Contex) © 2012-2014

[Cadox8](https://cadox8.github.io) © 2018-2020
[Cadox8](https://cadox8.es) © 2018-2021

## Donations
Building an Open Source Project is hard. You have to invert time and resources. :money_with_wings: :money_with_wings:

## TODO
* [x] Add a proper copyright header to all files.
* [x] Deploy to a public maven repo.
* [ ] Update to Xenforo 2.0
* [x] Better and more documentation
* [ ] Build a full Java-api
* [x] Feed the Cat

### TODO Docs
* [x] Authenticate
* [x] Create Alert
* [x] Create Conversation
* [x] Create Conversation Reply
* [x] Create Post
* [ ] Create Profile Post
* [ ] Create Profile Post Reply
* [x] Create Thread
* [x] Delete Post
* [ ] Delete User
* [ ] Downgrade User
* [ ] Edit Post
* [ ] Edit Thread
* [x] Edit User
* [x] Get Actions
* [x] Get Addon
* [x] Get Addons
* [x] Get Alerts
* [x] Get Avatar
* [ ] Get Conversation
* [ ] Get Conversations
* [ ] Get Group
* [x] Get Node
* [x] Get Nodes
* [x] Get Post
* [x] Get Posts
* [ ] Get Profile Post
* [ ] Get Profile Posts
* [ ] Get Resource
* [ ] Get Resources
* [ ] Get Resource Categories
* [x] Get Stats
* [ ] Get Thread
* [ ] Get Threads
* [x] Get User
* [ ] Get Users
* [ ] Get User Upgrade
* [ ] Get User Upgrades
* [x] Login
* [x] Logout
* [ ] Register
* [ ] Search
* [ ] Search Threads
* [ ] Upgrade User
* [ ] Get Unread Posts
* [ ] Edit User Mod

0 comments on commit 8786198

Please sign in to comment.