This repository has been archived by the owner on May 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vijai Kumar Suriyababu
committed
Mar 3, 2021
1 parent
3b1ce0f
commit 8a205a3
Showing
6 changed files
with
15 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
worker: python heroku.py | ||
worker: python irccloud.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,17 +17,7 @@ https://vijaikumar.in/keeping-your-irccloud-client-always-connected-for-free-82d | |
* Requests library | ||
|
||
### For use in your own VPS | ||
- Be sure to have `python-dev` installed in your machine. | ||
- Clone the repository with `git clone https://github.com/vijaiaeroastro/irccloud.git` | ||
- Enter into the cloned repository with `cd irccloud` | ||
- Install the requirements with `python -m pip install -r requirements.txt` | ||
- If the above command fails, install `python-pip` | ||
- Use the bash script `irccloud_cronjob` provided for ease of use | ||
- You can also specify everything on a `crontab` entry instead. Just type `crontab -e`, choose your favourite text editor | ||
and add this to it (this will be executed every hour): | ||
`0 * * * * IRCCLOUD_USERNAME="[email protected]" IRCCLOUD_PASSWORD="your_password" python3 /home/irccloud/irccloud/irccloud.py >/dev/null 2>&1` | ||
|
||
**NOTE**: If you have a VPS running Linux, i assume you know how to use basic Linux commands. I would highly advise you to do what suits your workflow the most. | ||
Check out [https://github.com/vijaiaeroastro/irccloud.self.git](https://github.com/vijaiaeroastro/irccloud.self.git) | ||
|
||
## License | ||
UNLICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
# A Simple script to keep an irc cloud client always alive | ||
__author__ = "S Vijaikumar" | ||
__email__ = "[email protected]" | ||
__copyright__ = "Copyright (C) 2021 S Vijai Kumar & EliteOfGods" | ||
__copyright__ = "Copyright (C) 2021 S Vijai Kumar" | ||
__license__ = "UNLICENSE" | ||
__version__ = "1.0" | ||
|
||
import requests | ||
import sys | ||
import traceback | ||
import logging | ||
from os import environ | ||
import json | ||
import time | ||
from timeloop import Timeloop | ||
from datetime import timedelta | ||
import random | ||
from os import environ | ||
|
||
class irccloud: | ||
""" | ||
|
@@ -68,7 +71,6 @@ def keep_alive(self): | |
ua_file = open("user_agents.json", "r+") | ||
user_agents = json.load(ua_file) | ||
ua_file.close() | ||
|
||
stream_url = "https://www.irccloud.com/chat/stream" | ||
headers = {"Connection" : "keep-alive", | ||
"Accept-Encoding" : "gzip,deflate,sdch", | ||
|
@@ -96,7 +98,10 @@ def runner(self): | |
self.log.error("IRC Cloud Session could not be Kept alive.") | ||
|
||
|
||
if __name__ == "__main__": | ||
tl = Timeloop() | ||
|
||
@tl.job(interval=timedelta(seconds=3600)) | ||
def timed_executor(): | ||
try: | ||
email = environ.get("IRCCLOUD_USERNAME") | ||
password = environ.get("IRCCLOUD_PASSWORD") | ||
|
@@ -108,3 +113,6 @@ def runner(self): | |
except Exception: | ||
traceback.print_exc(file=sys.stdout) | ||
sys.exit(0) | ||
|
||
if __name__ == "__main__": | ||
tl.start(block=True) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
python-3.7.2 | ||
python-3.9.0 |