FXaPi is a unofficial api module for the site fxp.co.il I wrote it for fun and for my own personal use.
The module emulates the browser actions by sending requests to the site server. The module isn't loading any type of files while sending requests to the site and that makes it faster
This package can be installed from GitHub or with pip
(please install it from github if you can)
pip install fxapi
from fxapi import *
import time
user = Fxp('USERNAME', 'PASSWORD')
@user.live.events.on(FxpPm)
def on_thread(fxp_obj):
print('New pm')
@user.live.events.on(FxpComment)
def on_comment(fxp_obj):
print('New comment')
@user.live.events.on(FxpThread)
def on_thread(fxp_obj):
print('New thread')
# you can use several events together
@user.live.events.on([FxpThread, FxpComment])
def on_event(fxp_obj):
print('New thread / comment')
if user.login():
print(f'Login success - "{user.username}"')
live = user.live.connect(debug=False)
if live:
live.register(21)
live.idle()
else:
print('Login failed')
-
- username
- user_id
- id
- content
- forum_id
- comment_id
- title
- prefix
- quoted_me
- newthread
- newcomment
-
- username
- user_id
- id
- content
- thread_id
- forum_id
- thread_title
- posts_number
- quoted_me
-
- username
- user_id
- id
- content
- parent_id
-
- login()
- refresh_securitytoken()
- create_thread(title, content, forum_id, prefix=None)
- comment(thread_id, content, spam_prevention=False)
- edit_comment(comment_id, content, append=False)
- like(comment_id)
- reply(fxp_obj, content, spam_prevention=False)
- create_private_chat(to, title, content)
- send_private_chat(to, pmid, content)
- report_comment(comment_id, reason)
- verify_username(username)
- register(username, password, email)
- get_forum_threads(forum_id, page=1, post_per_page=25)
- get_userid_by_name(username)
-
- create()
- Finish the base
- Organize the code
- Add more web interface features
- Add event queue to catch all