GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - volafiled/python-volapi: NOT DED?

BranchesTags
Open more actions menu

Latest commit

 

History

348 Commits
348 Commits

Folders and files

NameName
Last commit message
Last commit date
docs/examples
docs/examples
 
 
volapi
volapi
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
README.rst
README.rst
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 

Repository files navigation

Volafile API (volapi)

https://img.shields.io/badge/style-BLACKED-black.svg?longCache=true&style=flat-square

Installation

pip3 install volapi

or for version with faster json module, orjson

pip3 install 'volapi[FAST_JSON]'

If you have it installed already but want to update:

pip3 install volapi -U

or

pip3 install 'volapi[FAST_JSON]' -U

Examples

Basic

# Import volapi and a Room interface
from volapi import Room

# beepi will close at the end of this scope
with Room("BEEPi", "SameFag") as beepi:
    # optional login using a password
    beepi.user.login("hunter2")
    # Upload a file under a new filename and save the id
    fid = beepi.upload_file("images/disgusted.jpg", upload_as="mfw.jpg")
    # Show off your file in the chat
    beepi.post_chat("mfw posting from volapi @{}".format(fid))

Listening

Getting urls of all the files in the room:

from volapi import Room

with Room("BEEPi", "ScrappyBoy") as BEEPi:
    BEEPi.listen(once=True)
    for f in BEEPi.files:
        print(f.url)

Some basic trolling can be achieved with just a few lines of code.

from volapi import Room

with Room("BEEPi", "Stallman") as BEEPi:
    def interject(msg):
        if "linux" in msg.lower() and msg.nick != BEEPi.user.nick:
            BEEPi.post_chat("Don't you mean GNU/Linux?")
    BEEPi.add_listener("chat", interject)
    BEEPi.listen()

You can troll more than one room in parallel:

from functools import partial
from volapi import Room, listen_many

with Room("BEEPi", "Stallman") as BEEPi, Room("HvoXwS", "Popman") as HvoXwS:
    def interjectBEEPi(msg, room):
        if "linux" in msg.lower() and msg.nick != room.user.nick:
            room.post_chat("Don't you mean GNU/Linux?")
    def interjectHvoXwS(msg, room):
        if "hollywood" in msg.lower() and msg.nick != room.user.nick:
            room.post_chat("Don't you mean GNU/Hollywood?")
    BEEPi.add_listener("chat", partial(interjectBEEPi, room=BEEPi))
    HvoXwS.add_listener("chat", partial(interjectHvoXwS, room=HvoXwS))
    listen_many(BEEPi, HvoXwS)

Contributing

Just do whatever, and post a pull request. No guarantee of a merge tho!

If you cannot code, then please consider making a donation to our favorite charity "Cucks in Need Croatia" as one of our own, a user named "auxo", is politically procecuted for being a cuck in his native Croatia.

About

NOT DED?

volafile.org

Topics

apipythonvolafile

Resources

Readme
MIT license
Activity
Custom properties

Stars

5 stars

Watchers

9 watching

Forks

4 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.