GithubHelp home page GithubHelp logo

nandhaxd / sakura_fm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from awesome-tofu/sakura_fm

1.0 0.0 1.0 7 KB

sakura.fm scraper

Home Page: https://pypi.org/project/sakura-fm/

License: MIT License

Python 100.00%

sakura_fm's Introduction

Sakura Python Client

This is a Python client for the Sakura API. It provides methods to authenticate, send messages, get selfies, and more.

Installation

You can install the Sakura Python Client using pip:

pip install sakura_fm

Usage

First, import the Client class from the sakura package:

from sakura_fm import Client

Next, create an instance of the Client class, passing your Sakura username, password and mongo uri to the constructor:

client = Client(
    username = "your_username",
    password = "your_password",
    mongo = "your_mongodb_uri"
)

Now you can use the methods of the Client class to interact with the Sakura API.

Sending a Message

To send a message, use the sendMessage method by passing a random unique integer as UID you want and a character id and prompt:

# https://www.sakura.fm/chat/dmDCgmq
# the parameter after /chat/ is character id (/chat/{char_id})

response = client.sendMessage(1234, 'dmDCgmq', 'Hello Kazuko')
print(response)

reponse will return a json like this:

{
    "chat_id": "u3q9YN7",
    "reply": "*jumps slightly* Oh! Uh, hi there. I didn't see you come in."
}

Getting a Selfie

To get a selfie, use the get_selfie method we have to pass that old unique id which we sent in sendMessage:

response = client.get_selfie(1234)
print(response)

response will return an image url

Deleting the database

To delete the databse containing this whole uid to chat id connection, use this function:

response = client.delete_db()
print(response)

response will return True if it is success

That's all for now

sakura_fm's People

Contributors

awesome-tofu avatar

Stargazers

AKIRA ISHIKKI avatar

Forkers

ashui501

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.