Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
cleaning up irccloud repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Vijai Kumar Suriyababu committed Mar 3, 2021
1 parent 3b1ce0f commit 8a205a3
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 155 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
worker: python heroku.py
worker: python irccloud.py

12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
118 changes: 0 additions & 118 deletions heroku.py

This file was deleted.

16 changes: 12 additions & 4 deletions irccloud.py
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:
"""
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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")
Expand All @@ -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)
20 changes: 0 additions & 20 deletions irccloud_cronjob

This file was deleted.

2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.7.2
python-3.9.0

0 comments on commit 8a205a3

Please sign in to comment.