YouTube Channel Cloud Droid contact us... SUBSCRIBE

Cloud UI JS APIs

Before using these APIs please note that these are only available in v2.0.
Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated
Cloud UI JS APIs
Cloud UI JS APIs

Get user IP info:

utils.getIp(refresh?: boolean): Promise<IpResult>

Use the above method of utils object to get the user ip information. The interface IpResult is as shown:

interface Location {
  cca2: string;
  city: string;
  iata: string;
  lat: number;
  lon: number;
  region: string;
}

interface IpResult {
  colo: string;
  country?: string;
  fl: string;
  gateway: "off" | "on";
  http: string;
  ip: string;
  loc: string;
  location?: Location;
  rbi: "off" | "on";
  sliver: string;
  sni: string;
  timestamp: number;
  tls: string;
  userAgent: string;
  visitScheme: string;
  warp: "off" | "on";
}
Example:
utils.getIp().then((result) => {
  console.log("The IP is", result.ip);
});

Multithreading using Web Worker

You can use utils.Worker constructor to create a new worker thread.

Example:
const worker = new utils.Worker((self, register) => {
  register((ctx) => {
    return {
      hello: ()=> `[from:worker]: Hello! ${ctx.message}`
    }
  });
}, {
  context: { message: "My message" },
  name: "my-worker"
});

worker.call("hello").then(result => {
  console.log(result);
});

Formatting Blogger image url

utils.formatImage(bloggerImageUrl: string, options?: Options): string

You can create a new image url from existing blogger image url by modifying some of its parameters. Available options are:

interface Options {
  width?: number;
  height?: number;
  size?: number;
  ratio?: number;
  forceScaling?: boolean;
  flipHorizontally?: boolean;
  flipVertically?: boolean;
  rotate?: number;
  symbol?: number;
  download?: boolean;
  format?: "png" | "jpg" | "webp";
  cache?: number;
}
Example:
const bloggerImageUrl = "https://4.bp.blogspot.com/.../name.webp";

const modifiedImageUrl = utils.formatImage(bloggerImageUrl, {
  format: "webp"
});

console.log(modifiedImageUrl);

There are more but they are not documented yet!

إرسال تعليق

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.