Jump to content

xat for developers


Recommended Posts

  • Game Makers

 

There are examples, usage, documentation, etc. Everything is safe because it is connected directly to the xat.com, not everything is loaded under https (SSL) because xat denied a few headers, but still working fine.

 

 

Changelog:

Spoiler
  • Countries fixed again on version 1.1 and 2.1
  • Countries are fixed in version 1 & 2.

 

Version 2.1:

Spoiler

Github: https://github.com/xlaming/xatlib 

Print: https://prnt.sc/n78anu

 

Functions

  • ShortnamePrice(STRING);
  • ChatPrice(STRING);
  • ChatInformation(STRING);
  • XatsToDays(INT);
  • DaysToXats(INT);
  • ChatPromotionPrice(FLOAT);
  • IsBannerApproved(STRING);
  • DelistCheck(STRING);
  • PowerInformation(STRING);
  • ChatSearch(STRING);
  • IdToReg(INT);
  • RegToId(STRING);
  • SeeUserGifts(INT);
  • LatestPower();
  • StorePrices();
  • ChatsPromoted();
  • PowerReleaseCountdown();
  • HugList();
  • JinxList();
  • PopularCountries();

 

Installation:

  1. composer install
  2. Edit the file example.php or add it whatever you want
  3. php example.php 

 

Version 1.1:

Spoiler

Github: https://github.com/xlaming/xat

 

Functions & Modes:

  • shortname 
    • Get shortname prices
    • Required: (alpha-numeric)
    • Return: (string) or (int)
  • chatgroup
    • Get chat prices
    • Required: (alpha-numeric)
    • Return: (string) or (int)
  • dx
    • Convert days to xats
    • Required: (numeric)
    • Return: (int)
  • xd
    • Convert xats to days
    • Required: (numeric)
    • Return: (int)
  • promotion
    • Get chat promotion prices
    • Required: (float 0.5 * 6)
    • Return: (string) or (object)
  • bannercheck
    • Verify if the banner URL is approved
    • Required: (alpha-numeric)
    • Return: (string) or (int)
  • powerinfo
    • Get power information
    • Required: (alpha-numeric)
    • Return: (object)
  • id2reg
    • Convert ID to register
    • Required: (numeric)
    • Return: (string)
  • reg2id
    • Convert register to ID
    • Required: (alpha-numeric)
    • Return: (int)
  • delistcheck
    • Verify if the chat is delisted
    • Required: (alpha-numeric)
    • Return: (int)
  • chatsearch
    • Search for xat chats
    • Required: (alpha-numeric)
    • Return: (object)
  • chatinfo
    • Get information about chats
    • Required: (alpha-numeric)
    • Return: (object)
  • gifts
    • Get gifts from an xat user
    • Required: (numeric)
    • Return: (object)
  • latest
    • Get information about the latest power
    • Return: (object)
  • store
    • Get all xat store prices
    • Return: (object)
  • promoted
    • Get chats promoted
    • Return:(object)
  • pcd
    • Get countdown from the latest power
    • Return: (object)
  • hugs
    • Load the hug list
    • Return: (object)
  • jinx
    • Load the jinx list
    • Return: (object)
  • countries
    • See top five countries where xat is most common
    • Return: (object)

 

 

=> Actually you can test it using https://xatblog.net/api/MODE/ARGS

https://xatblog.net/api/shortname/DaBest
https://xatblog.net/api/id2reg/42
https://xatblog.net/api/latest
https://xatblog.net/api/promoted

 

Info:

Edited by xLaming
New version released
  • Award 4
  • Thanks 1
  • Huh? 1
Link to post
Share on other sites
  • Advanced Members
5 hours ago, Jedi said:

Actually your code is unusable.

Works perfectly fine for me? Maybe give some info on whatever your problem is so he can better assist you, lol.

tlx0yWR.png 

  • Award 2
Link to post
Share on other sites
  • Advanced Members
7 hours ago, Jedi said:

"Works perfectly" != ready to be implemented in any project.

You said unusable. Also, I don't see how it's not ready to be implemented? Please enlighten me as I implemented it just fine.

His his style of doing things isn't wrong just because it doesn't fit your conventional style.

 

7 hours ago, Jedi said:

Edit: I did a fast review of your code.

So you didn't even look at his code in the first place before deeming it unusable? Laughable.

 

7 hours ago, Jedi said:

First, do you want to use PHP7 for this library?

Instead of cast each return of your functions, you can use https://www.php.net/manual/en/functions.returning-values.php#functions.returning-values.type-declaration

And returns are random, object/int/bool, can you use string? (return formated json)

[redacted]

 

After all these changes, you will be able to use composer.

Then if a developer wants to use your library, he can use "composer require xlaming/xatlib", and use it in his project "Use xlaming/xatlib" "$gifts = xatlib::userGifts(123456);"

All personal preference.

 

7 hours ago, Jedi said:

About code replicate, you have 3 times is_epic, is_game... It would be better to create a private function.

Facts. Reusable code is cool.

  • Award 2
  • Wow 1
Link to post
Share on other sites
  • Advanced Members
2 hours ago, Daniel said:

Industry standard?

Perhaps, though I don't think providing a standard format/usage for something is the same as it being the standard.

2 hours ago, Daniel said:

Ease of use?

I dunno dude this seems like a lot more work than just copy pasting. Imo, maybe on a larger scale it would tailor to usability, but not for a 1-file resource.

 

To each their own, still all personal preference.

  • Award 2
Link to post
Share on other sites
  • Game Makers

Keep calm guys!!!

 

 

Version 2.0 released using Composer, I'm currently using PHP 7.3

 

I have changed a lot, so you need to see the function names.

 

Read more:  https://github.com/xLaming/xatlib/blob/master/README.md

 

Screenshot: https://prnt.sc/n78anu

 

I didn't the part of is_epic etc...

  • Award 3
Link to post
Share on other sites
  • Game Makers

Countries is now fixed (again, due updates). We won't have problems with this anymore.

 

Try it: https://xatblog.net/api/countries

 

Our place for testing/using API is up " https://xatblog.net/api/ "

Edited by xLaming
Link to post
Share on other sites
  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.