From 6aa74c74da0040e9252352faa47e44a8b8aa1925 Mon Sep 17 00:00:00 2001 From: sandeshpatel Date: Sat, 12 Aug 2017 09:41:13 +0530 Subject: [PATCH 1/7] introduced welcome function --- bot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bot.py b/bot.py index 9977cba..8c218af 100644 --- a/bot.py +++ b/bot.py @@ -22,6 +22,8 @@ def joinchan(chan): def hello(): ircsock.send("PRIVMSG " + channel + " :Hello! Welcome to jec-dev! Happy Hacking! :D\n") +def welcome(): + pass if __name__ == '__main__': server = "irc.freenode.net" @@ -55,6 +57,7 @@ def hello(): if ircmsg.find(":Hello " + botnick) != -1: hello() + if ircmsg.find('PING') != -1: ping() else: From f326b14c3d2e8363ec8c2c7e58a1e30ea28b762b Mon Sep 17 00:00:00 2001 From: sandeshpatel Date: Sat, 12 Aug 2017 11:24:57 +0530 Subject: [PATCH 2/7] created user_list_file --- bot.py | 13 ++++++++++++- user_list_file | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 user_list_file diff --git a/bot.py b/bot.py index 8c218af..350e8df 100644 --- a/bot.py +++ b/bot.py @@ -3,6 +3,8 @@ import datetime from dateutil import tz +#use four space indentation only + from_zone = tz.gettz('UTC') to_zone = tz.gettz('Asia/Kolkata') @@ -23,7 +25,8 @@ def hello(): ircsock.send("PRIVMSG " + channel + " :Hello! Welcome to jec-dev! Happy Hacking! :D\n") def welcome(): - pass + ircsock.send("PRIVMSG " + channel + "testing welcome function will be implemented by deepika , remove this line \n") + if __name__ == '__main__': server = "irc.freenode.net" @@ -42,6 +45,9 @@ def welcome(): ircsock.send("NICK " + botnick + "\n") joinchan(channel) + + with open("user_list_file",'r') as usernames: + user_list = usernames.read().split(' ') while 1: try: @@ -66,6 +72,11 @@ def welcome(): user = split_message[0].split('!')[0] ircmsg = local.time().strftime('%H:%M') + ' ' + user + ' ' + ' '.join(split_message[3:]) log.write(ircmsg+'\n') + if user not in user_list: + welcome() + user_list.append(user) + with open("user_list_file" , 'a') as usernames: + usernames.write(user+' ') time.sleep(2) except Exception: continue diff --git a/user_list_file b/user_list_file new file mode 100644 index 0000000..ebdb3ab --- /dev/null +++ b/user_list_file @@ -0,0 +1 @@ +san-d knrai deepika From 0449898d7ec16449cd013d10a935f567dd055048 Mon Sep 17 00:00:00 2001 From: sandeshpatel Date: Sat, 12 Aug 2017 16:49:21 +0530 Subject: [PATCH 3/7] unexpected users and logging --- bot.py | 12 +- logging/logs/12-08-17.log | 276 ++++++++++++++++++++++++++++++++++++++ user_list_file | 15 ++- 3 files changed, 297 insertions(+), 6 deletions(-) create mode 100644 logging/logs/12-08-17.log diff --git a/bot.py b/bot.py index 350e8df..32d91ee 100644 --- a/bot.py +++ b/bot.py @@ -25,13 +25,14 @@ def hello(): ircsock.send("PRIVMSG " + channel + " :Hello! Welcome to jec-dev! Happy Hacking! :D\n") def welcome(): + print("welcome") ircsock.send("PRIVMSG " + channel + "testing welcome function will be implemented by deepika , remove this line \n") if __name__ == '__main__': server = "irc.freenode.net" channel = "#jec-dev" - botnick = "jec-dev-bot" + botnick = "jec-dev-botwain" ircsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Here we connect to the server using the port 6667 @@ -39,15 +40,15 @@ def welcome(): ircsock.setblocking(False) - ircsock.send("USER " + botnick + " " + botnick + " " + - botnick + " Test Bot\n") # user authentication + ircsock.send("USER " + botnick + " " + botnick + " " + + botnick + " Test Bot\n") # user authentication # here we actually assign the nick to the bot ircsock.send("NICK " + botnick + "\n") joinchan(channel) with open("user_list_file",'r') as usernames: - user_list = usernames.read().split(' ') + user_list = usernames.read().split('\n') while 1: try: @@ -74,9 +75,10 @@ def welcome(): log.write(ircmsg+'\n') if user not in user_list: welcome() + print("hello world") user_list.append(user) with open("user_list_file" , 'a') as usernames: - usernames.write(user+' ') + usernames.write(user+'\n') time.sleep(2) except Exception: continue diff --git a/logging/logs/12-08-17.log b/logging/logs/12-08-17.log new file mode 100644 index 0000000..75f8b60 --- /dev/null +++ b/logging/logs/12-08-17.log @@ -0,0 +1,276 @@ +21:29 :wilhelm.freenode.net :*** Looking up your hostname... +21:29 :wilhelm.freenode.net :*** Checking Ident +:wilhelm.freenode.net NOTICE * :*** Couldn't look up your hostname +21:29 :wilhelm.freenode.net :*** No Ident response +21:29 edia.co.uk/ 372 jec-dev-botwain :- this server! +:wilhelm.freenode.net 372 jec-dev-botwain :- +:wilhelm.freenode.net 372 jec-dev-botwain :- Welcome to freenode - supporting the free and open source +:wilhelm.freenode.net 372 jec-dev-botwain :- software communities since 1998. +:wilhelm.freenode.net 372 jec-dev-botwain :- +:wilhelm.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and +:wilhelm.freenode.net 372 jec-dev-botwain :- accept our policies as set out on http://www.freenode.net +:wilhelm.freenode.net 372 jec-dev-botwain :- freenode runs an open proxy scanner. Please join #freenode for +:wilhelm.freenode.net 372 jec-dev-botwain :- any network-related questions or queries, where a number of +:wilhelm.freenode.net 372 jec-dev-botwain :- volunteer staff and helpful users will be happy to assist you. +:wilhelm.freenode.net 372 jec-dev-botwain :- +:wilhelm.freenode.net 372 jec-dev-botwain :- You can meet us at FOSSCON (http://www.fosscon.org) where we get +:wilhelm.freenode.net 372 jec-dev-botwain :- together with like-minded FOSS enthusiasts for talks and +:wilhelm.freenode.net 372 jec-dev-botwain :- real-life collaboration. +:wilhelm.freenode.net 372 jec-dev-botwain :- +:wilhelm.freenode.net 372 jec-dev-botwain :- We would like to thank Private Internet Access +:wilhelm.freenode.net 372 jec-dev-botwain :- (https://www.privateinternetaccess.com/) and the other +:wilhelm.freenode.net 372 jec-dev-botwain :- organisations that help keep freenode and our other projects +:wilhelm.freenode.net 372 jec-dev-botwain :- running for their sustained support. +:wilhelm.freenode.net 372 jec-dev-botwain :- +:wilhelm.freenode.net 372 jec-dev-botwain :- In particular we would like to thank the sponsor +:wilhelm.freenode.net 372 jec-dev-botwain :- of this server, details of which can be found above. +:wilhelm.freenode.net 372 jec-dev-botwain :- +:wilhelm.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that yo +21:30 u and +:wilhelm.freenode.net 372 jec-dev-botwain :- agree with our policies and guidelines as published on +:wilhelm.freenode.net 372 jec-dev-botwain :- https://freenode.net +:wilhelm.freenode.net 376 jec-dev-botwain :End of /MOTD command. +:jec-dev-botwain MODE jec-dev-botwain :+i +:jec-dev-botwain!~jec-dev-b@47.247.10.187 JOIN #jec-dev +:wilhelm.freenode.net 332 jec-dev-botwain #jec-dev :Logs : http://50.116.0.97:5000/ | 2 years of #jec-dev ٩(◕‿◕)۶ | chill out with fellow developers of JEC, discuss and please refrain from using sir/ma'am :) +:wilhelm.freenode.net 333 jec-dev-botwain #jec-dev vipul20!uid64067@gateway/web/irccloud.com/x-hurfjjwrmqfmpsgu 1502385858 +:wilhelm.freenode.net 353 jec-dev-botwain = #jec-dev :jec-dev-botwain ary_yaar pikapi amey deepika san-D knrai vipul20 RPandey jec-dev-bot @ChanServ +:wilhelm.freenode.net 366 jec-dev-botwain #jec-dev :End of /NAMES list. +:wilhelm.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel +:wilhelm.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel +21:30 :wilhelm.freenode.net #jec-devtesting :No such nick/channel +21:30 :sanD_ +21:30 :wilhelm.freenode.net #jec-devtesting :No such nick/channel +21:31 :sanD_ Quit +21:32 :sandesh +21:32 :wilhelm.freenode.net #jec-devtesting :No such nick/channel +21:33 :san-D :vipul20: bot.py (jec-dev-botwain :D) is runnig now +21:33 :wilhelm.freenode.net #jec-devtesting :No such nick/channel +21:33 :san-D :but not welcomming anyone looks like some fault in code +21:34 :ary_yaar timeout: 260 seconds +21:34 :wilhelm.freenode.net #jec-devtesting :No such nick/channel +21:34 :pikapi :Yoooooooooo +21:34 :wilhelm.freenode.net #jec-devtesting :No such nick/channel +21:40 :verne.freenode.net :*** Looking up your hostname... +21:40 :verne.freenode.net :*** Checking Ident +:verne.freenode.net NOTICE * :*** Couldn't look up your hostname +21:40 :verne.freenode.net :*** No Ident response +21:40 ec-dev-botwain server! +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net 372 jec-dev-botwain :- VERNE, Jules (1828-1905). Born in Nantes, France, Verne was +:verne.freenode.net 372 jec-dev-botwain :- a pioneering french author known for novels such as Twenty +:verne.freenode.net 372 jec-dev-botwain :- Thousand Leagues Under the Sea, A Journey to the Center of the +:verne.freenode.net 372 jec-dev-botwain :- Earth, and Around the World in Eighty Days. Often lauded as the +:verne.freenode.net 372 jec-dev-botwain :- Father of science fiction, Verne wrote about concepts such as +:verne.freenode.net 372 jec-dev-botwain :- space travel, skyscrapers, and worldwide communications +:verne.freenode.net 372 jec-dev-botwain :- networks long before these ideas became popularised or realised. +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net 372 jec-dev-botwain :- Welcome to freenode - supporting the free and open source +:verne.freenode.net 372 jec-dev-botwain :- software communities since 1998. +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and +:verne.freenode.net 372 jec-dev-botwain :- accept our policies as set out on http://www.freenode.net +:verne.freenode.net 372 jec-dev-botwain :- freenode runs an open proxy scanner. Please join #freenode for +:verne.freenode.net 372 jec-dev-botwain :- any network-related questions or queries, where a number of +:verne.freenode.net 372 jec-dev-botwain :- volunteer staff and helpful users will be happy to assist you. +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net 372 jec-dev-botwain :- You can meet us at FOSSCON (http://www.fosscon.org) where we get +:verne.freenode.net 372 jec-dev-botwain :- together with like-minded FOSS enthusiasts for talks and +:verne.freenode.net 372 jec-dev-botwain :- real-life collaboration. +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net +21:40 :- We would like to thank Private Internet Access +:verne.freenode.net 372 jec-dev-botwain :- (https://www.privateinternetaccess.com/) and the other +:verne.freenode.net 372 jec-dev-botwain :- organisations that help keep freenode and our other projects +:verne.freenode.net 372 jec-dev-botwain :- running for their sustained support. +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net 372 jec-dev-botwain :- In particular we would like to thank the sponsor +:verne.freenode.net 372 jec-dev-botwain :- of this server, details of which can be found above. +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and +:verne.freenode.net 372 jec-dev-botwain :- agree with our policies and guidelines as published on +:verne.freenode.net 372 jec-dev-botwain :- https://freenode.net +:verne.freenode.net 376 jec-dev-botwain :End of /MOTD command. +:jec-dev-botwain MODE jec-dev-botwain :+i +21:40 :jec-dev-botwain 332 jec-dev-botwain #jec-dev :Logs : http://50.116.0.97:5000/ | 2 years of #jec-dev ٩(◕‿◕)۶ | chill out with fellow developers of JEC, discuss and please refrain from using sir/ma'am :) +:verne.freenode.net 333 jec-dev-botwain #jec-dev vipul20!uid64067@gateway/web/irccloud.com/x-hurfjjwrmqfmpsgu 1502385859 +:verne.freenode.net 353 jec-dev-botwain = #jec-dev :jec-dev-botwain pikapi amey deepika san-D knrai vipul20 RPandey jec-dev-bot @ChanServ +:verne.freenode.net 366 jec-dev-botwain #jec-dev :End of /NAMES list. +:verne.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel +:verne.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel +21:40 :verne.freenode.net #jec-devtesting :No such nick/channel +21:40 :sandesh +21:41 :knrai_ +21:41 :verne.freenode.net #jec-devtesting :No such nick/channel +21:42 :knrai_ Quit +21:43 :karatkievich.freenode.net :*** Looking up your hostname... +21:43 :karatkievich.freenode.net :*** Checking Ident +:karatkievich.freenode.net NOTICE * :*** Couldn't look up your hostname +21:43 :karatkievich.freenode.net :*** No Ident response +21:43 .net. 372 jec-dev-botwain :- http://www.tatacommunications.com/ for sponsoring +:karatkievich.freenode.net 372 jec-dev-botwain :- this server! +:karatkievich.freenode.net 372 jec-dev-botwain :- +:karatkievich.freenode.net 372 jec-dev-botwain :- KARATKIEVICH, ULADZIMIR (1930-1984) was a Belarusian +:karatkievich.freenode.net 372 jec-dev-botwain :- romantic writer. After his first published work was a poem +:karatkievich.freenode.net 372 jec-dev-botwain :- in 1951, he followed up with novels, short stories, plays, +:karatkievich.freenode.net 372 jec-dev-botwain :- essays, articles and screenplays. His probably most popular +:karatkievich.freenode.net 372 jec-dev-botwain :- work is the novel 'King Stakh's Wild Hunt' (1964). Most his +:karatkievich.freenode.net 372 jec-dev-botwain :- novels are about Belarus's past. He won many national +:karatkievich.freenode.net 372 jec-dev-botwain :- literary awards and influenced the Belarusian literature's +:karatkievich.freenode.net 372 jec-dev-botwain :- development of historical themes. +:karatkievich.freenode.net 372 jec-dev-botwain :- +:karatkievich.freenode.net 372 jec-dev-botwain :- +:karatkievich.freenode.net 372 jec-dev-botwain :- Welcome to freenode - supporting the free and open source +:karatkievich.freenode.net 372 jec-dev-botwain :- software communities since 1998. +:karatkievich.freenode.net 372 jec-dev-botwain :- +:karatkievich.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and +:karatkievich.freenode.net 372 jec-dev-botwain :- accept our policies as set out on http://www.freenode.net +:karatkievich.freenode.net 372 jec-dev-botwain :- freenode runs an open proxy scanner. Please join #freenode for +:karatkievich.freenode.net 372 jec-dev-botwain :- any network-related questions or queries, where a number of +:karatkievich.freenode.net 372 jec-dev-botwain :- volunteer staff and helpful users will be happy to assist you. +:karatkievich.freenode.net 372 jec-dev-botwain :- +21:43 :karatkievich.freenode.net :- You can meet us at FOSSCON (http://www.fosscon.org) where we get +:karatkievich.freenode.net 372 jec-dev-botwain :- together with like-minded FOSS enthusiasts for talks and +:karatkievich.freenode.net 372 jec-dev-botwain :- real-life collaboration. +:karatkievich.freenode.net 372 jec-dev-botwain :- +:karatkievich.freenode.net 372 jec-dev-botwain :- We would like to thank Private Internet Access +:karatkievich.freenode.net 372 jec-dev-botwain :- (https://www.privateinternetaccess.com/) and the other +:karatkievich.freenode.net 372 jec-dev-botwain :- organisations that help keep freenode and our other projects +:karatkievich.freenode.net 372 jec-dev-botwain :- running for their sustained support. +:karatkievich.freenode.net 372 jec-dev-botwain :- +:karatkievich.freenode.net 372 jec-dev-botwain :- In particular we would like to thank the sponsor +:karatkievich.freenode.net 372 jec-dev-botwain :- of this server, details of which can be found above. +:karatkievich.freenode.net 372 jec-dev-botwain :- +:karatkievich.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and +:karatkievich.freenode.net 372 jec-dev-botwain :- agree with our policies and guidelines as published on +:karatkievich.freenode.net 372 jec-dev-botwain :- https://freenode.net +:karatkievich.freenode.net 376 jec-dev-botwain :End of /MOTD command. +:jec-dev-botwain MODE jec-dev-botwain :+i +:jec-dev-botwain!~jec-dev-b@47.247.10.187 JOIN #jec-dev +:karatkievich.freenode.net 332 jec-dev-botwain #jec-dev :Logs : http://50.116.0.97:5000/ | 2 years of #jec-dev ٩(◕‿◕)۶ | chill out with fellow developers of JEC, discuss and please refrain from using sir/ma'am :) +:karatkievich.freenode.net 333 jec-dev-botwain #jec-dev vipul20!uid64067@gateway/web/irccloud.com/x-hurfjjwrmqfmpsgu 1502385858 +:karatkievich.freenode.net 353 jec-dev-botwain = #jec-dev :jec-dev-botwain sandesh pikapi amey deepika san-D knrai vipul20 RPandey jec-dev-bot @ChanServ +:karatkievich. +21:43 freenode.net #jec-dev :End of /NAMES list. +:karatkievich.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel +:karatkievich.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel +21:43 :karatkievich.freenode.net #jec-devtesting :No such nick/channel +21:44 :knrai_ +21:50 :wolfe.freenode.net :*** Looking up your hostname... +21:50 :wolfe.freenode.net :*** Checking Ident +:wolfe.freenode.net NOTICE * :*** Couldn't look up your hostname +21:50 :wolfe.freenode.net :*** No Ident response +21:50 twain server! +:wolfe.freenode.net 372 jec-dev-botwain :- +:wolfe.freenode.net 372 jec-dev-botwain :- WOLFE, GENE [1931-]. Prolific writer of short stories and +:wolfe.freenode.net 372 jec-dev-botwain :- novels. His best-known work is the multi-volume novel The +:wolfe.freenode.net 372 jec-dev-botwain :- Book of the New Sun. He has won multiple awards including +:wolfe.freenode.net 372 jec-dev-botwain :- the Nebula Award, the World Fantasy Award, The Campell +:wolfe.freenode.net 372 jec-dev-botwain :- Memorial Award and the Locus Award. He was awarded the World +:wolfe.freenode.net 372 jec-dev-botwain :- Fantasy Award for lifetime achievement in 1996. +:wolfe.freenode.net 372 jec-dev-botwain :- +:wolfe.freenode.net 372 jec-dev-botwain :- Welcome to freenode - supporting the free and open source +:wolfe.freenode.net 372 jec-dev-botwain :- software communities since 1998. +:wolfe.freenode.net 372 jec-dev-botwain :- +:wolfe.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and +:wolfe.freenode.net 372 jec-dev-botwain :- accept our policies as set out on http://www.freenode.net +:wolfe.freenode.net 372 jec-dev-botwain :- freenode runs an open proxy scanner. Please join #freenode for +:wolfe.freenode.net 372 jec-dev-botwain :- any network-related questions or queries, where a number of +:wolfe.freenode.net 372 jec-dev-botwain :- volunteer staff and helpful users will be happy to assist you. +:wolfe.freenode.net 372 jec-dev-botwain :- +:wolfe.freenode.net 372 jec-dev-botwain :- You can meet us at FOSSCON (http://www.fosscon.org) where we get +:wolfe.freenode.net 372 jec-dev-botwain :- together with like-minded FOSS enthusiasts for talks and +:wolfe.freenode.net 372 jec-dev-botwain :- real-life collaboration. +:wolfe.freenode.net 372 jec-dev-botwain :- +:wolfe.freenode.net 372 jec-dev-botwain :- We would like to thank Private Internet Access +:wolfe.freenode.net 372 jec-dev-botwain :- (https://www.privateinternetaccess.com/) and the other +:wolfe.freenode.ne +21:50 t :- organisations that help keep freenode and our other projects +:wolfe.freenode.net 372 jec-dev-botwain :- running for their sustained support. +:wolfe.freenode.net 372 jec-dev-botwain :- +:wolfe.freenode.net 372 jec-dev-botwain :- In particular we would like to thank the sponsor +:wolfe.freenode.net 372 jec-dev-botwain :- of this server, details of which can be found above. +:wolfe.freenode.net 372 jec-dev-botwain :- +:wolfe.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and +:wolfe.freenode.net 372 jec-dev-botwain :- agree with our policies and guidelines as published on +:wolfe.freenode.net 372 jec-dev-botwain :- https://freenode.net +:wolfe.freenode.net 376 jec-dev-botwain :End of /MOTD command. +:jec-dev-botwain MODE jec-dev-botwain :+i +21:50 :jec-dev-botwain 332 jec-dev-botwain #jec-dev :Logs : http://50.116.0.97:5000/ | 2 years of #jec-dev ٩(◕‿◕)۶ | chill out with fellow developers of JEC, discuss and please refrain from using sir/ma'am :) +:wolfe.freenode.net 333 jec-dev-botwain #jec-dev vipul20!uid64067@gateway/web/irccloud.com/x-hurfjjwrmqfmpsgu 1502385858 +:wolfe.freenode.net 353 jec-dev-botwain = #jec-dev :jec-dev-botwain u043 knrai_ sandesh pikapi amey deepika san-D knrai vipul20 RPandey jec-dev-bot @ChanServ +:wolfe.freenode.net 366 jec-dev-botwain #jec-dev :End of /NAMES list. +:wolfe.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel +:wolfe.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel +:wolfe.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel +21:50 :wolfe.freenode.net #jec-devtesting :No such nick/channel +21:53 :pikapi timeout: 260 seconds +21:53 :knrai_ :just testing +:wolfe.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel +21:53 :wolfe.freenode.net #jec-devtesting :No such nick/channel +21:57 :knrai__ +21:57 :wolfe.freenode.net #jec-devtesting :No such nick/channel +21:57 :knrai_ timeout: 260 seconds +21:58 :knrai__ +21:58 :knrai__ +21:59 :Gaurav_ +21:59 :wolfe.freenode.net #jec-devtesting :No such nick/channel +22:03 :verne.freenode.net :*** Looking up your hostname... +22:03 :verne.freenode.net :*** Checking Ident +:verne.freenode.net NOTICE * :*** Couldn't look up your hostname +22:03 :verne.freenode.net :*** No Ident response +22:03 ec-dev-botwain server! +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net 372 jec-dev-botwain :- VERNE, Jules (1828-1905). Born in Nantes, France, Verne was +:verne.freenode.net 372 jec-dev-botwain :- a pioneering french author known for novels such as Twenty +:verne.freenode.net 372 jec-dev-botwain :- Thousand Leagues Under the Sea, A Journey to the Center of the +:verne.freenode.net 372 jec-dev-botwain :- Earth, and Around the World in Eighty Days. Often lauded as the +:verne.freenode.net 372 jec-dev-botwain :- Father of science fiction, Verne wrote about concepts such as +:verne.freenode.net 372 jec-dev-botwain :- space travel, skyscrapers, and worldwide communications +:verne.freenode.net 372 jec-dev-botwain :- networks long before these ideas became popularised or realised. +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net 372 jec-dev-botwain :- Welcome to freenode - supporting the free and open source +:verne.freenode.net 372 jec-dev-botwain :- software communities since 1998. +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and +:verne.freenode.net 372 jec-dev-botwain :- accept our policies as set out on http://www.freenode.net +:verne.freenode.net 372 jec-dev-botwain :- freenode runs an open proxy scanner. Please join #freenode for +:verne.freenode.net 372 jec-dev-botwain :- any network-related questions or queries, where a number of +:verne.freenode.net 372 jec-dev-botwain :- volunteer staff and helpful users will be happy to assist you. +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net 372 jec-dev-botwain :- You can meet us at FOSSCON (http://www.fosscon.org) where we get +:verne.freenode.net 372 jec-dev-botwain :- together with like-minded FOSS enthusiasts for talks and +:verne.freenode.net 372 jec-dev-botwain :- real-life collaboration. +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net +22:03 :- We would like to thank Private Internet Access +:verne.freenode.net 372 jec-dev-botwain :- (https://www.privateinternetaccess.com/) and the other +:verne.freenode.net 372 jec-dev-botwain :- organisations that help keep freenode and our other projects +:verne.freenode.net 372 jec-dev-botwain :- running for their sustained support. +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net 372 jec-dev-botwain :- In particular we would like to thank the sponsor +:verne.freenode.net 372 jec-dev-botwain :- of this server, details of which can be found above. +:verne.freenode.net 372 jec-dev-botwain :- +:verne.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and +:verne.freenode.net 372 jec-dev-botwain :- agree with our policies and guidelines as published on +:verne.freenode.net 372 jec-dev-botwain :- https://freenode.net +:verne.freenode.net 376 jec-dev-botwain :End of /MOTD command. +:jec-dev-botwain MODE jec-dev-botwain :+i +:jec-dev-botwain!~jec-dev-b@47.247.10.187 JOIN #jec-dev +:verne.freenode.net 332 jec-dev-botwain #jec-dev :Logs : http://50.116.0.97:5000/ | 2 years of #jec-dev ٩(◕‿◕)۶ | chill out with fellow developers of JEC, discuss and please refrain from using sir/ma'am :) +:verne.freenode.net 333 jec-dev-botwain #jec-dev vipul20!uid64067@gateway/web/irccloud.com/x-hurfjjwrmqfmpsgu 1502385859 +:verne.freenode.net 353 jec-dev-botwain = #jec-dev :jec-dev-botwain Gaurav_ u043 sandesh amey deepika san-D knrai vipul20 RPandey jec-dev-bot @ChanServ +:verne.freenode.net 366 jec-dev-botwain #jec-dev :End of /NAMES list. +:verne.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel +:verne.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel +22:05 :sandesh ::Hello jec-dev-botwain +22:05 :jec-dev-bot :Hello! Welcome to jec-dev! Happy Hacking! :D +:verne.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel +22:05 :verne.freenode.net #jec-devtesting :No such nick/channel +22:06 :knrai :hay sandesh jec-dev-bot is responding to his botwain call +22:06 :verne.freenode.net #jec-devtesting :No such nick/channel +22:14 :barjavel.freenode.net :*** Looking up your hostname... +22:14 :barjavel.freenode.net :*** Checking Ident +:barjavel.freenode.net NOTICE * :*** Couldn't look up your hostname diff --git a/user_list_file b/user_list_file index ebdb3ab..51da711 100644 --- a/user_list_file +++ b/user_list_file @@ -1 +1,14 @@ -san-d knrai deepika +:wolfe.freenode.net +twain +t +:jec-dev-botwain +:pikapi +:knrai_ +:knrai__ +:Gaurav_ +:verne.freenode.net +ec-dev-botwain +:sandesh +:jec-dev-bot +:knrai +:barjavel.freenode.net From a3fe1766fb441bda7b4e1fd69c1692c1da4b6c6a Mon Sep 17 00:00:00 2001 From: sandeshpatel Date: Sun, 13 Aug 2017 23:00:55 +0530 Subject: [PATCH 4/7] trying to run bot.py --- bot.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bot.py b/bot.py index 32d91ee..7063dae 100644 --- a/bot.py +++ b/bot.py @@ -21,12 +21,13 @@ def joinchan(chan): ircsock.send("JOIN " + chan + "\n") -def hello(): - ircsock.send("PRIVMSG " + channel + " :Hello! Welcome to jec-dev! Happy Hacking! :D\n") - def welcome(): - print("welcome") - ircsock.send("PRIVMSG " + channel + "testing welcome function will be implemented by deepika , remove this line \n") + print("inside welcome function") + ircsock.send("PRIVMSG " + channel + ":Hello! " + user+ " Welcome to jec-dev! Happy Hacking! :D\n") + ircsock.send("PRIVMSG " + channel + user + " plese introduce yourself with name, branch, sem, and area of interest ") + +def hello(): + ircsock.send("PRIVMSG " + channel + ":Hello! Welcome to jec-dev! Happy Hacking! :D\n") if __name__ == '__main__': @@ -47,7 +48,7 @@ def welcome(): joinchan(channel) - with open("user_list_file",'r') as usernames: + with open("user_list_file",'rb') as usernames: user_list = usernames.read().split('\n') while 1: @@ -75,7 +76,7 @@ def welcome(): log.write(ircmsg+'\n') if user not in user_list: welcome() - print("hello world") + print("welcome called") user_list.append(user) with open("user_list_file" , 'a') as usernames: usernames.write(user+'\n') From 2e3ebbda79bc030155433e26145f2c0654713e14 Mon Sep 17 00:00:00 2001 From: sandeshpatel Date: Mon, 14 Aug 2017 00:11:07 +0530 Subject: [PATCH 5/7] added message wrapper --- bot.py | 12 +++++------- user_list_file | 40 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/bot.py b/bot.py index 7063dae..30b5470 100644 --- a/bot.py +++ b/bot.py @@ -8,6 +8,8 @@ from_zone = tz.gettz('UTC') to_zone = tz.gettz('Asia/Kolkata') +def msg_wrapper(): + return "PRIVMSG " + channel + " " def ping(): # responds to server pings ircsock.send("PONG :pingis\n") @@ -22,18 +24,15 @@ def joinchan(chan): def welcome(): - print("inside welcome function") - ircsock.send("PRIVMSG " + channel + ":Hello! " + user+ " Welcome to jec-dev! Happy Hacking! :D\n") - ircsock.send("PRIVMSG " + channel + user + " plese introduce yourself with name, branch, sem, and area of interest ") - + ircsock.send(msg_wrapper() + ":Hello! " + user+ " Welcome to jec-dev! Please introduce yourself with name, branch, sem, and area of interest \n ") def hello(): - ircsock.send("PRIVMSG " + channel + ":Hello! Welcome to jec-dev! Happy Hacking! :D\n") + ircsock.send(msg_wrapper() + ":Hello! Welcome to jec-dev! Happy Hacking! :D\n") if __name__ == '__main__': server = "irc.freenode.net" channel = "#jec-dev" - botnick = "jec-dev-botwain" + botnick = "jec-dev-bot" ircsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Here we connect to the server using the port 6667 @@ -76,7 +75,6 @@ def hello(): log.write(ircmsg+'\n') if user not in user_list: welcome() - print("welcome called") user_list.append(user) with open("user_list_file" , 'a') as usernames: usernames.write(user+'\n') diff --git a/user_list_file b/user_list_file index 51da711..cae8c33 100644 --- a/user_list_file +++ b/user_list_file @@ -1,8 +1,6 @@ :wolfe.freenode.net twain t -:jec-dev-botwain -:pikapi :knrai_ :knrai__ :Gaurav_ @@ -12,3 +10,41 @@ ec-dev-botwain :jec-dev-bot :knrai :barjavel.freenode.net +:tolkien.freenode.net +998. +:tolkien.freenode.net +:zeekhuge +:orwell.freenode.net +well.freenode.net +998. +:tolkien.freenode.net +:krishna +:cherryh.freenode.net +:leguin.freenode.net +iversity +keep +:san-D +:Mutter +:jec-dev-botwain +:krishna__ +Bearstech +:karatkievich.freenode.net +.net. +@ChanServ +:karatkievich.freenode.net +:Mutter_ +:u043 +:rajaniemi.freenode.net +net +thank +:BongBrahm_durwas +:durwasa +:vipul20 +:krishna2 +:knrai1 +:botwayne +:pikapi +c-dev-botwain +372 +:Guest75630 +:san-d_ From eb4f15ea7738255e425d4751b1afb02b2b59d855 Mon Sep 17 00:00:00 2001 From: sandeshpatel Date: Wed, 16 Aug 2017 13:56:25 +0530 Subject: [PATCH 6/7] removed logging from git tracking --- logging/index.html | 166 ------------------ logging/logs/12-08-17.log | 276 ------------------------------ logging/serve.go | 23 --- logging/server.sh | 16 -- logging/static/css/style.css | 89 ---------- logging/static/js/index.js | 302 --------------------------------- logging/static/less/style.less | 79 --------- 7 files changed, 951 deletions(-) delete mode 100644 logging/index.html delete mode 100644 logging/logs/12-08-17.log delete mode 100644 logging/serve.go delete mode 100644 logging/server.sh delete mode 100644 logging/static/css/style.css delete mode 100644 logging/static/js/index.js delete mode 100644 logging/static/less/style.less diff --git a/logging/index.html b/logging/index.html deleted file mode 100644 index 57f5adb..0000000 --- a/logging/index.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - bootstrap compatable calendar - - - - - -
-

LOGS

-
-
- - - - - - diff --git a/logging/logs/12-08-17.log b/logging/logs/12-08-17.log deleted file mode 100644 index 75f8b60..0000000 --- a/logging/logs/12-08-17.log +++ /dev/null @@ -1,276 +0,0 @@ -21:29 :wilhelm.freenode.net :*** Looking up your hostname... -21:29 :wilhelm.freenode.net :*** Checking Ident -:wilhelm.freenode.net NOTICE * :*** Couldn't look up your hostname -21:29 :wilhelm.freenode.net :*** No Ident response -21:29 edia.co.uk/ 372 jec-dev-botwain :- this server! -:wilhelm.freenode.net 372 jec-dev-botwain :- -:wilhelm.freenode.net 372 jec-dev-botwain :- Welcome to freenode - supporting the free and open source -:wilhelm.freenode.net 372 jec-dev-botwain :- software communities since 1998. -:wilhelm.freenode.net 372 jec-dev-botwain :- -:wilhelm.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and -:wilhelm.freenode.net 372 jec-dev-botwain :- accept our policies as set out on http://www.freenode.net -:wilhelm.freenode.net 372 jec-dev-botwain :- freenode runs an open proxy scanner. Please join #freenode for -:wilhelm.freenode.net 372 jec-dev-botwain :- any network-related questions or queries, where a number of -:wilhelm.freenode.net 372 jec-dev-botwain :- volunteer staff and helpful users will be happy to assist you. -:wilhelm.freenode.net 372 jec-dev-botwain :- -:wilhelm.freenode.net 372 jec-dev-botwain :- You can meet us at FOSSCON (http://www.fosscon.org) where we get -:wilhelm.freenode.net 372 jec-dev-botwain :- together with like-minded FOSS enthusiasts for talks and -:wilhelm.freenode.net 372 jec-dev-botwain :- real-life collaboration. -:wilhelm.freenode.net 372 jec-dev-botwain :- -:wilhelm.freenode.net 372 jec-dev-botwain :- We would like to thank Private Internet Access -:wilhelm.freenode.net 372 jec-dev-botwain :- (https://www.privateinternetaccess.com/) and the other -:wilhelm.freenode.net 372 jec-dev-botwain :- organisations that help keep freenode and our other projects -:wilhelm.freenode.net 372 jec-dev-botwain :- running for their sustained support. -:wilhelm.freenode.net 372 jec-dev-botwain :- -:wilhelm.freenode.net 372 jec-dev-botwain :- In particular we would like to thank the sponsor -:wilhelm.freenode.net 372 jec-dev-botwain :- of this server, details of which can be found above. -:wilhelm.freenode.net 372 jec-dev-botwain :- -:wilhelm.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that yo -21:30 u and -:wilhelm.freenode.net 372 jec-dev-botwain :- agree with our policies and guidelines as published on -:wilhelm.freenode.net 372 jec-dev-botwain :- https://freenode.net -:wilhelm.freenode.net 376 jec-dev-botwain :End of /MOTD command. -:jec-dev-botwain MODE jec-dev-botwain :+i -:jec-dev-botwain!~jec-dev-b@47.247.10.187 JOIN #jec-dev -:wilhelm.freenode.net 332 jec-dev-botwain #jec-dev :Logs : http://50.116.0.97:5000/ | 2 years of #jec-dev ٩(◕‿◕)۶ | chill out with fellow developers of JEC, discuss and please refrain from using sir/ma'am :) -:wilhelm.freenode.net 333 jec-dev-botwain #jec-dev vipul20!uid64067@gateway/web/irccloud.com/x-hurfjjwrmqfmpsgu 1502385858 -:wilhelm.freenode.net 353 jec-dev-botwain = #jec-dev :jec-dev-botwain ary_yaar pikapi amey deepika san-D knrai vipul20 RPandey jec-dev-bot @ChanServ -:wilhelm.freenode.net 366 jec-dev-botwain #jec-dev :End of /NAMES list. -:wilhelm.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel -:wilhelm.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel -21:30 :wilhelm.freenode.net #jec-devtesting :No such nick/channel -21:30 :sanD_ -21:30 :wilhelm.freenode.net #jec-devtesting :No such nick/channel -21:31 :sanD_ Quit -21:32 :sandesh -21:32 :wilhelm.freenode.net #jec-devtesting :No such nick/channel -21:33 :san-D :vipul20: bot.py (jec-dev-botwain :D) is runnig now -21:33 :wilhelm.freenode.net #jec-devtesting :No such nick/channel -21:33 :san-D :but not welcomming anyone looks like some fault in code -21:34 :ary_yaar timeout: 260 seconds -21:34 :wilhelm.freenode.net #jec-devtesting :No such nick/channel -21:34 :pikapi :Yoooooooooo -21:34 :wilhelm.freenode.net #jec-devtesting :No such nick/channel -21:40 :verne.freenode.net :*** Looking up your hostname... -21:40 :verne.freenode.net :*** Checking Ident -:verne.freenode.net NOTICE * :*** Couldn't look up your hostname -21:40 :verne.freenode.net :*** No Ident response -21:40 ec-dev-botwain server! -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net 372 jec-dev-botwain :- VERNE, Jules (1828-1905). Born in Nantes, France, Verne was -:verne.freenode.net 372 jec-dev-botwain :- a pioneering french author known for novels such as Twenty -:verne.freenode.net 372 jec-dev-botwain :- Thousand Leagues Under the Sea, A Journey to the Center of the -:verne.freenode.net 372 jec-dev-botwain :- Earth, and Around the World in Eighty Days. Often lauded as the -:verne.freenode.net 372 jec-dev-botwain :- Father of science fiction, Verne wrote about concepts such as -:verne.freenode.net 372 jec-dev-botwain :- space travel, skyscrapers, and worldwide communications -:verne.freenode.net 372 jec-dev-botwain :- networks long before these ideas became popularised or realised. -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net 372 jec-dev-botwain :- Welcome to freenode - supporting the free and open source -:verne.freenode.net 372 jec-dev-botwain :- software communities since 1998. -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and -:verne.freenode.net 372 jec-dev-botwain :- accept our policies as set out on http://www.freenode.net -:verne.freenode.net 372 jec-dev-botwain :- freenode runs an open proxy scanner. Please join #freenode for -:verne.freenode.net 372 jec-dev-botwain :- any network-related questions or queries, where a number of -:verne.freenode.net 372 jec-dev-botwain :- volunteer staff and helpful users will be happy to assist you. -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net 372 jec-dev-botwain :- You can meet us at FOSSCON (http://www.fosscon.org) where we get -:verne.freenode.net 372 jec-dev-botwain :- together with like-minded FOSS enthusiasts for talks and -:verne.freenode.net 372 jec-dev-botwain :- real-life collaboration. -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net -21:40 :- We would like to thank Private Internet Access -:verne.freenode.net 372 jec-dev-botwain :- (https://www.privateinternetaccess.com/) and the other -:verne.freenode.net 372 jec-dev-botwain :- organisations that help keep freenode and our other projects -:verne.freenode.net 372 jec-dev-botwain :- running for their sustained support. -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net 372 jec-dev-botwain :- In particular we would like to thank the sponsor -:verne.freenode.net 372 jec-dev-botwain :- of this server, details of which can be found above. -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and -:verne.freenode.net 372 jec-dev-botwain :- agree with our policies and guidelines as published on -:verne.freenode.net 372 jec-dev-botwain :- https://freenode.net -:verne.freenode.net 376 jec-dev-botwain :End of /MOTD command. -:jec-dev-botwain MODE jec-dev-botwain :+i -21:40 :jec-dev-botwain 332 jec-dev-botwain #jec-dev :Logs : http://50.116.0.97:5000/ | 2 years of #jec-dev ٩(◕‿◕)۶ | chill out with fellow developers of JEC, discuss and please refrain from using sir/ma'am :) -:verne.freenode.net 333 jec-dev-botwain #jec-dev vipul20!uid64067@gateway/web/irccloud.com/x-hurfjjwrmqfmpsgu 1502385859 -:verne.freenode.net 353 jec-dev-botwain = #jec-dev :jec-dev-botwain pikapi amey deepika san-D knrai vipul20 RPandey jec-dev-bot @ChanServ -:verne.freenode.net 366 jec-dev-botwain #jec-dev :End of /NAMES list. -:verne.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel -:verne.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel -21:40 :verne.freenode.net #jec-devtesting :No such nick/channel -21:40 :sandesh -21:41 :knrai_ -21:41 :verne.freenode.net #jec-devtesting :No such nick/channel -21:42 :knrai_ Quit -21:43 :karatkievich.freenode.net :*** Looking up your hostname... -21:43 :karatkievich.freenode.net :*** Checking Ident -:karatkievich.freenode.net NOTICE * :*** Couldn't look up your hostname -21:43 :karatkievich.freenode.net :*** No Ident response -21:43 .net. 372 jec-dev-botwain :- http://www.tatacommunications.com/ for sponsoring -:karatkievich.freenode.net 372 jec-dev-botwain :- this server! -:karatkievich.freenode.net 372 jec-dev-botwain :- -:karatkievich.freenode.net 372 jec-dev-botwain :- KARATKIEVICH, ULADZIMIR (1930-1984) was a Belarusian -:karatkievich.freenode.net 372 jec-dev-botwain :- romantic writer. After his first published work was a poem -:karatkievich.freenode.net 372 jec-dev-botwain :- in 1951, he followed up with novels, short stories, plays, -:karatkievich.freenode.net 372 jec-dev-botwain :- essays, articles and screenplays. His probably most popular -:karatkievich.freenode.net 372 jec-dev-botwain :- work is the novel 'King Stakh's Wild Hunt' (1964). Most his -:karatkievich.freenode.net 372 jec-dev-botwain :- novels are about Belarus's past. He won many national -:karatkievich.freenode.net 372 jec-dev-botwain :- literary awards and influenced the Belarusian literature's -:karatkievich.freenode.net 372 jec-dev-botwain :- development of historical themes. -:karatkievich.freenode.net 372 jec-dev-botwain :- -:karatkievich.freenode.net 372 jec-dev-botwain :- -:karatkievich.freenode.net 372 jec-dev-botwain :- Welcome to freenode - supporting the free and open source -:karatkievich.freenode.net 372 jec-dev-botwain :- software communities since 1998. -:karatkievich.freenode.net 372 jec-dev-botwain :- -:karatkievich.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and -:karatkievich.freenode.net 372 jec-dev-botwain :- accept our policies as set out on http://www.freenode.net -:karatkievich.freenode.net 372 jec-dev-botwain :- freenode runs an open proxy scanner. Please join #freenode for -:karatkievich.freenode.net 372 jec-dev-botwain :- any network-related questions or queries, where a number of -:karatkievich.freenode.net 372 jec-dev-botwain :- volunteer staff and helpful users will be happy to assist you. -:karatkievich.freenode.net 372 jec-dev-botwain :- -21:43 :karatkievich.freenode.net :- You can meet us at FOSSCON (http://www.fosscon.org) where we get -:karatkievich.freenode.net 372 jec-dev-botwain :- together with like-minded FOSS enthusiasts for talks and -:karatkievich.freenode.net 372 jec-dev-botwain :- real-life collaboration. -:karatkievich.freenode.net 372 jec-dev-botwain :- -:karatkievich.freenode.net 372 jec-dev-botwain :- We would like to thank Private Internet Access -:karatkievich.freenode.net 372 jec-dev-botwain :- (https://www.privateinternetaccess.com/) and the other -:karatkievich.freenode.net 372 jec-dev-botwain :- organisations that help keep freenode and our other projects -:karatkievich.freenode.net 372 jec-dev-botwain :- running for their sustained support. -:karatkievich.freenode.net 372 jec-dev-botwain :- -:karatkievich.freenode.net 372 jec-dev-botwain :- In particular we would like to thank the sponsor -:karatkievich.freenode.net 372 jec-dev-botwain :- of this server, details of which can be found above. -:karatkievich.freenode.net 372 jec-dev-botwain :- -:karatkievich.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and -:karatkievich.freenode.net 372 jec-dev-botwain :- agree with our policies and guidelines as published on -:karatkievich.freenode.net 372 jec-dev-botwain :- https://freenode.net -:karatkievich.freenode.net 376 jec-dev-botwain :End of /MOTD command. -:jec-dev-botwain MODE jec-dev-botwain :+i -:jec-dev-botwain!~jec-dev-b@47.247.10.187 JOIN #jec-dev -:karatkievich.freenode.net 332 jec-dev-botwain #jec-dev :Logs : http://50.116.0.97:5000/ | 2 years of #jec-dev ٩(◕‿◕)۶ | chill out with fellow developers of JEC, discuss and please refrain from using sir/ma'am :) -:karatkievich.freenode.net 333 jec-dev-botwain #jec-dev vipul20!uid64067@gateway/web/irccloud.com/x-hurfjjwrmqfmpsgu 1502385858 -:karatkievich.freenode.net 353 jec-dev-botwain = #jec-dev :jec-dev-botwain sandesh pikapi amey deepika san-D knrai vipul20 RPandey jec-dev-bot @ChanServ -:karatkievich. -21:43 freenode.net #jec-dev :End of /NAMES list. -:karatkievich.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel -:karatkievich.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel -21:43 :karatkievich.freenode.net #jec-devtesting :No such nick/channel -21:44 :knrai_ -21:50 :wolfe.freenode.net :*** Looking up your hostname... -21:50 :wolfe.freenode.net :*** Checking Ident -:wolfe.freenode.net NOTICE * :*** Couldn't look up your hostname -21:50 :wolfe.freenode.net :*** No Ident response -21:50 twain server! -:wolfe.freenode.net 372 jec-dev-botwain :- -:wolfe.freenode.net 372 jec-dev-botwain :- WOLFE, GENE [1931-]. Prolific writer of short stories and -:wolfe.freenode.net 372 jec-dev-botwain :- novels. His best-known work is the multi-volume novel The -:wolfe.freenode.net 372 jec-dev-botwain :- Book of the New Sun. He has won multiple awards including -:wolfe.freenode.net 372 jec-dev-botwain :- the Nebula Award, the World Fantasy Award, The Campell -:wolfe.freenode.net 372 jec-dev-botwain :- Memorial Award and the Locus Award. He was awarded the World -:wolfe.freenode.net 372 jec-dev-botwain :- Fantasy Award for lifetime achievement in 1996. -:wolfe.freenode.net 372 jec-dev-botwain :- -:wolfe.freenode.net 372 jec-dev-botwain :- Welcome to freenode - supporting the free and open source -:wolfe.freenode.net 372 jec-dev-botwain :- software communities since 1998. -:wolfe.freenode.net 372 jec-dev-botwain :- -:wolfe.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and -:wolfe.freenode.net 372 jec-dev-botwain :- accept our policies as set out on http://www.freenode.net -:wolfe.freenode.net 372 jec-dev-botwain :- freenode runs an open proxy scanner. Please join #freenode for -:wolfe.freenode.net 372 jec-dev-botwain :- any network-related questions or queries, where a number of -:wolfe.freenode.net 372 jec-dev-botwain :- volunteer staff and helpful users will be happy to assist you. -:wolfe.freenode.net 372 jec-dev-botwain :- -:wolfe.freenode.net 372 jec-dev-botwain :- You can meet us at FOSSCON (http://www.fosscon.org) where we get -:wolfe.freenode.net 372 jec-dev-botwain :- together with like-minded FOSS enthusiasts for talks and -:wolfe.freenode.net 372 jec-dev-botwain :- real-life collaboration. -:wolfe.freenode.net 372 jec-dev-botwain :- -:wolfe.freenode.net 372 jec-dev-botwain :- We would like to thank Private Internet Access -:wolfe.freenode.net 372 jec-dev-botwain :- (https://www.privateinternetaccess.com/) and the other -:wolfe.freenode.ne -21:50 t :- organisations that help keep freenode and our other projects -:wolfe.freenode.net 372 jec-dev-botwain :- running for their sustained support. -:wolfe.freenode.net 372 jec-dev-botwain :- -:wolfe.freenode.net 372 jec-dev-botwain :- In particular we would like to thank the sponsor -:wolfe.freenode.net 372 jec-dev-botwain :- of this server, details of which can be found above. -:wolfe.freenode.net 372 jec-dev-botwain :- -:wolfe.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and -:wolfe.freenode.net 372 jec-dev-botwain :- agree with our policies and guidelines as published on -:wolfe.freenode.net 372 jec-dev-botwain :- https://freenode.net -:wolfe.freenode.net 376 jec-dev-botwain :End of /MOTD command. -:jec-dev-botwain MODE jec-dev-botwain :+i -21:50 :jec-dev-botwain 332 jec-dev-botwain #jec-dev :Logs : http://50.116.0.97:5000/ | 2 years of #jec-dev ٩(◕‿◕)۶ | chill out with fellow developers of JEC, discuss and please refrain from using sir/ma'am :) -:wolfe.freenode.net 333 jec-dev-botwain #jec-dev vipul20!uid64067@gateway/web/irccloud.com/x-hurfjjwrmqfmpsgu 1502385858 -:wolfe.freenode.net 353 jec-dev-botwain = #jec-dev :jec-dev-botwain u043 knrai_ sandesh pikapi amey deepika san-D knrai vipul20 RPandey jec-dev-bot @ChanServ -:wolfe.freenode.net 366 jec-dev-botwain #jec-dev :End of /NAMES list. -:wolfe.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel -:wolfe.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel -:wolfe.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel -21:50 :wolfe.freenode.net #jec-devtesting :No such nick/channel -21:53 :pikapi timeout: 260 seconds -21:53 :knrai_ :just testing -:wolfe.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel -21:53 :wolfe.freenode.net #jec-devtesting :No such nick/channel -21:57 :knrai__ -21:57 :wolfe.freenode.net #jec-devtesting :No such nick/channel -21:57 :knrai_ timeout: 260 seconds -21:58 :knrai__ -21:58 :knrai__ -21:59 :Gaurav_ -21:59 :wolfe.freenode.net #jec-devtesting :No such nick/channel -22:03 :verne.freenode.net :*** Looking up your hostname... -22:03 :verne.freenode.net :*** Checking Ident -:verne.freenode.net NOTICE * :*** Couldn't look up your hostname -22:03 :verne.freenode.net :*** No Ident response -22:03 ec-dev-botwain server! -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net 372 jec-dev-botwain :- VERNE, Jules (1828-1905). Born in Nantes, France, Verne was -:verne.freenode.net 372 jec-dev-botwain :- a pioneering french author known for novels such as Twenty -:verne.freenode.net 372 jec-dev-botwain :- Thousand Leagues Under the Sea, A Journey to the Center of the -:verne.freenode.net 372 jec-dev-botwain :- Earth, and Around the World in Eighty Days. Often lauded as the -:verne.freenode.net 372 jec-dev-botwain :- Father of science fiction, Verne wrote about concepts such as -:verne.freenode.net 372 jec-dev-botwain :- space travel, skyscrapers, and worldwide communications -:verne.freenode.net 372 jec-dev-botwain :- networks long before these ideas became popularised or realised. -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net 372 jec-dev-botwain :- Welcome to freenode - supporting the free and open source -:verne.freenode.net 372 jec-dev-botwain :- software communities since 1998. -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and -:verne.freenode.net 372 jec-dev-botwain :- accept our policies as set out on http://www.freenode.net -:verne.freenode.net 372 jec-dev-botwain :- freenode runs an open proxy scanner. Please join #freenode for -:verne.freenode.net 372 jec-dev-botwain :- any network-related questions or queries, where a number of -:verne.freenode.net 372 jec-dev-botwain :- volunteer staff and helpful users will be happy to assist you. -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net 372 jec-dev-botwain :- You can meet us at FOSSCON (http://www.fosscon.org) where we get -:verne.freenode.net 372 jec-dev-botwain :- together with like-minded FOSS enthusiasts for talks and -:verne.freenode.net 372 jec-dev-botwain :- real-life collaboration. -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net -22:03 :- We would like to thank Private Internet Access -:verne.freenode.net 372 jec-dev-botwain :- (https://www.privateinternetaccess.com/) and the other -:verne.freenode.net 372 jec-dev-botwain :- organisations that help keep freenode and our other projects -:verne.freenode.net 372 jec-dev-botwain :- running for their sustained support. -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net 372 jec-dev-botwain :- In particular we would like to thank the sponsor -:verne.freenode.net 372 jec-dev-botwain :- of this server, details of which can be found above. -:verne.freenode.net 372 jec-dev-botwain :- -:verne.freenode.net 372 jec-dev-botwain :- By connecting to freenode you indicate that you have read and -:verne.freenode.net 372 jec-dev-botwain :- agree with our policies and guidelines as published on -:verne.freenode.net 372 jec-dev-botwain :- https://freenode.net -:verne.freenode.net 376 jec-dev-botwain :End of /MOTD command. -:jec-dev-botwain MODE jec-dev-botwain :+i -:jec-dev-botwain!~jec-dev-b@47.247.10.187 JOIN #jec-dev -:verne.freenode.net 332 jec-dev-botwain #jec-dev :Logs : http://50.116.0.97:5000/ | 2 years of #jec-dev ٩(◕‿◕)۶ | chill out with fellow developers of JEC, discuss and please refrain from using sir/ma'am :) -:verne.freenode.net 333 jec-dev-botwain #jec-dev vipul20!uid64067@gateway/web/irccloud.com/x-hurfjjwrmqfmpsgu 1502385859 -:verne.freenode.net 353 jec-dev-botwain = #jec-dev :jec-dev-botwain Gaurav_ u043 sandesh amey deepika san-D knrai vipul20 RPandey jec-dev-bot @ChanServ -:verne.freenode.net 366 jec-dev-botwain #jec-dev :End of /NAMES list. -:verne.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel -:verne.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel -22:05 :sandesh ::Hello jec-dev-botwain -22:05 :jec-dev-bot :Hello! Welcome to jec-dev! Happy Hacking! :D -:verne.freenode.net 401 jec-dev-botwain #jec-devtesting :No such nick/channel -22:05 :verne.freenode.net #jec-devtesting :No such nick/channel -22:06 :knrai :hay sandesh jec-dev-bot is responding to his botwain call -22:06 :verne.freenode.net #jec-devtesting :No such nick/channel -22:14 :barjavel.freenode.net :*** Looking up your hostname... -22:14 :barjavel.freenode.net :*** Checking Ident -:barjavel.freenode.net NOTICE * :*** Couldn't look up your hostname diff --git a/logging/serve.go b/logging/serve.go deleted file mode 100644 index 995cc5f..0000000 --- a/logging/serve.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Usage: - -p="8100": port to serve on - -d=".": the directory of static files to host -*/ -package main - -import ( - "flag" - "log" - "net/http" -) - -func main() { - port := flag.String("p", "8100", "port to serve on") - directory := flag.String("d", ".", "the directory of static file to host") - flag.Parse() - - http.Handle("/", http.FileServer(http.Dir(*directory))) - - log.Printf("Serving %s on HTTP port: %s\n", *directory, *port) - log.Fatal(http.ListenAndServe(":"+*port, nil)) -} diff --git a/logging/server.sh b/logging/server.sh deleted file mode 100644 index 9f26234..0000000 --- a/logging/server.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -case $1 in - start) - echo "Starting log server." - go run serve.go & - ;; - stop) - echo "Stopping log server." - sudo kill $(sudo lsof -t -i:5000) - ;; - *) - echo "jec-dev bot logging server." - echo $"Usage $0 {start|stop}" - exit 1 -esac -exit 0 diff --git a/logging/static/css/style.css b/logging/static/css/style.css deleted file mode 100644 index 25b375b..0000000 --- a/logging/static/css/style.css +++ /dev/null @@ -1,89 +0,0 @@ -.calendar-day { - width: 100px; - min-width: 100px; - max-width: 100px; - height: 80px; -} -.calendar-table { - margin: 0 auto; - width: 700px; -} -.selected { - background-color: #eee; -} -.outside .date { - color: #ccc; -} -.timetitle { - white-space: nowrap; - text-align: right; -} -.event { - border-top: 1px solid #b2dba1; - border-bottom: 1px solid #b2dba1; - background-image: linear-gradient(to bottom, #dff0d8 0px, #c8e5bc 100%); - background-repeat: repeat-x; - color: #3c763d; - border-width: 1px; - font-size: .75em; - padding: 0 .75em; - line-height: 2em; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - margin-bottom: 1px; -} -.event.begin { - border-left: 1px solid #b2dba1; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; -} -.event.end { - border-right: 1px solid #b2dba1; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; -} -.event.all-day { - border-top: 1px solid #9acfea; - border-bottom: 1px solid #9acfea; - background-image: linear-gradient(to bottom, #d9edf7 0px, #b9def0 100%); - background-repeat: repeat-x; - color: #31708f; - border-width: 1px; -} -.event.all-day.begin { - border-left: 1px solid #9acfea; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; -} -.event.all-day.end { - border-right: 1px solid #9acfea; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; -} -.event.clear { - background: none; - border: 1px solid transparent; -} -.table-tight > thead > tr > th, -.table-tight > tbody > tr > th, -.table-tight > tfoot > tr > th, -.table-tight > thead > tr > td, -.table-tight > tbody > tr > td, -.table-tight > tfoot > tr > td { - padding-left: 0; - padding-right: 0; -} -.table-tight-vert > thead > tr > th, -.table-tight-vert > tbody > tr > th, -.table-tight-vert > tfoot > tr > th, -.table-tight-vert > thead > tr > td, -.table-tight-vert > tbody > tr > td, -.table-tight-vert > tfoot > tr > td { - padding-top: 0; - padding-bottom: 0; -} - -.current { - cursor: pointer; -} diff --git a/logging/static/js/index.js b/logging/static/js/index.js deleted file mode 100644 index 2dc85c8..0000000 --- a/logging/static/js/index.js +++ /dev/null @@ -1,302 +0,0 @@ -var $currentPopover = null; -$(document).on('shown.bs.popover', function(ev) { - var $target = $(ev.target); - if ($currentPopover && ($currentPopover.get(0) != $target.get(0))) { - $currentPopover.popover('toggle'); - } - $currentPopover = $target; -}).on('hidden.bs.popover', function(ev) { - var $target = $(ev.target); - if ($currentPopover && ($currentPopover.get(0) == $target.get(0))) { - $currentPopover = null; - } -}); - - -//quicktmpl is a simple template language I threw together a while ago; it is not remotely secure to xss and probably has plenty of bugs that I haven't considered, but it basically works -//the design is a function I read in a blog post by John Resig (http://ejohn.org/blog/javascript-micro-templating/) and it is intended to be loosely translateable to a more comprehensive template language like mustache easily -$.extend({ - quicktmpl: function(template) { - return new Function("obj", "var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('" + template.replace(/[\r\t\n]/g, " ").split("{{").join("\t").replace(/((^|\}\})[^\t]*)'/g, "$1\r").replace(/\t:(.*?)\}\}/g, "',$1,'").split("\t").join("');").split("}}").join("p.push('").split("\r").join("\\'") + "');}return p.join('');") - } -}); - -$.extend(Date.prototype, { - //provides a string that is _year_month_day, intended to be widely usable as a css class - toDateCssClass: function() { - return '_' + this.getFullYear() + '_' + (this.getMonth() + 1) + '_' + this.getDate(); - }, - //this generates a number useful for comparing two dates; - toDateInt: function() { - return ((this.getFullYear() * 12) + this.getMonth()) * 32 + this.getDate(); - }, - toTimeString: function() { - var hours = this.getHours(), - minutes = this.getMinutes(), - hour = (hours > 12) ? (hours - 12) : hours, - ampm = (hours >= 12) ? ' pm' : ' am'; - if (hours === 0 && minutes === 0) { - return ''; - } - if (minutes > 0) { - return hour + ':' + minutes + ampm; - } - return hour + ampm; - } -}); - - -(function($) { - - //t here is a function which gets passed an options object and returns a string of html. I am using quicktmpl to create it based on the template located over in the html block - var t = $.quicktmpl($('#tmpl').get(0).innerHTML); - - function calendar($el, options) { - //actions aren't currently in the template, but could be added easily... - $el.on('click', '.js-cal-prev', function() { - switch (options.mode) { - case 'year': - options.date.setFullYear(options.date.getFullYear() - 1); - break; - case 'month': - options.date.setMonth(options.date.getMonth() - 1); - break; - case 'week': - options.date.setDate(options.date.getDate() - 7); - break; - case 'day': - options.date.setDate(options.date.getDate() - 1); - break; - } - draw(); - }).on('click', '.js-cal-next', function() { - switch (options.mode) { - case 'year': - options.date.setFullYear(options.date.getFullYear() + 1); - break; - case 'month': - options.date.setMonth(options.date.getMonth() + 1); - break; - case 'week': - options.date.setDate(options.date.getDate() + 7); - break; - case 'day': - options.date.setDate(options.date.getDate() + 1); - break; - } - draw(); - }).on('click', '.js-cal-option', function() { - var $t = $(this), - o = $t.data(); - if ($(this).hasClass('calendar-day current')) { - var curr = new Date(o.date) - var dd = ("0" + curr.getDate()).slice(-2) - var mm = ("0" + (curr.getMonth() + 1)).slice(-2) - var y = curr.getFullYear() % 2000; - - var formatted_date = dd + '-' + mm + '-' + y; - console.log(formatted_date) - window.location = '../logs/' + formatted_date + '.log' - } - - if (o.date) { - o.date = new Date(o.date); - } - $.extend(options, o); - draw(); - }).on('click', '.js-cal-years', function() { - var $t = $(this), - haspop = $t.data('popover'), - s = '', - y = options.date.getFullYear() - 2, - l = y + 5; - if (haspop) { - return true; - } - for (; y < l; y++) { - s += ''; - } - $t.popover({ - content: s, - html: true, - placement: 'auto top' - }).popover('toggle'); - return false; - }).on('click', '.event', function() { - var $t = $(this), - index = +($t.attr('data-index')), - haspop = $t.data('popover'), - data, time; - - if (haspop || isNaN(index)) { - return true; - } - data = options.data[index]; - time = data.start.toTimeString(); - if (time && data.end) { - time = time + ' - ' + data.end.toTimeString(); - } - $t.data('popover', true); - $t.popover({ - content: '

' + time + '

' + data.text, - html: true, - placement: 'auto left' - }).popover('toggle'); - return false; - }); - - function dayAddEvent(index, event) { - if (!!event.allDay) { - monthAddEvent(index, event); - return; - } - var $event = $('
', { - 'class': 'event', - text: event.title, - title: event.title, - 'data-index': index - }), - start = event.start, - end = event.end || start, - time = event.start.toTimeString(), - hour = start.getHours(), - timeclass = '.time-22-0', - startint = start.toDateInt(), - dateint = options.date.toDateInt(), - endint = end.toDateInt(); - if (startint > dateint || endint < dateint) { - return; - } - - if (!!time) { - $event.html('' + time + ' ' + $event.html()); - } - $event.toggleClass('begin', startint === dateint); - $event.toggleClass('end', endint === dateint); - if (hour < 6) { - timeclass = '.time-0-0'; - } - if (hour < 22) { - timeclass = '.time-' + hour + '-' + (start.getMinutes() < 30 ? '0' : '30'); - } - $(timeclass).append($event); - } - - function monthAddEvent(index, event) { - var $event = $('
', { - 'class': 'event', - text: event.title, - title: event.title, - 'data-index': index - }), - e = new Date(event.start), - dateclass = e.toDateCssClass(), - day = $('.' + e.toDateCssClass()), - empty = $('
', { - 'class': 'clear event', - html: ' ' - }), - numbevents = 0, - time = event.start.toTimeString(), - endday = event.end && $('.' + event.end.toDateCssClass()).length > 0, - checkanyway = new Date(e.getFullYear(), e.getMonth(), e.getDate() + 40), - existing, - i; - $event.toggleClass('all-day', !!event.allDay); - if (!!time) { - $event.html('' + time + ' ' + $event.html()); - } - if (!event.end) { - $event.addClass('begin end'); - $('.' + event.start.toDateCssClass()).append($event); - return; - } - - while (e <= event.end && (day.length || endday || options.date < checkanyway)) { - if (day.length) { - existing = day.find('.event').length; - numbevents = Math.max(numbevents, existing); - for (i = 0; i < numbevents - existing; i++) { - day.append(empty.clone()); - } - day.append( - $event.toggleClass('begin', dateclass === event.start.toDateCssClass()).toggleClass('end', dateclass === event.end.toDateCssClass()) - ); - $event = $event.clone(); - $event.html(' '); - } - e.setDate(e.getDate() + 1); - dateclass = e.toDateCssClass(); - day = $('.' + dateclass); - } - } - - function yearAddEvents(events, year) { - var counts = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - $.each(events, function(i, v) { - if (v.start.getFullYear() === year) { - counts[v.start.getMonth()]++; - } - }); - $.each(counts, function(i, v) { - if (v !== 0) { - $('.month-' + i).append('' + v + ''); - } - }); - } - - function draw() { - $el.html(t(options)); - //potential optimization (untested), this object could be keyed into a dictionary on the dateclass string; the object would need to be reset and the first entry would have to be made here - $('.' + (new Date()).toDateCssClass()).addClass('today'); - if (options.data && options.data.length) { - if (options.mode === 'year') { - yearAddEvents(options.data, options.date.getFullYear()); - } else if (options.mode === 'month' || options.mode === 'week') { - $.each(options.data, monthAddEvent); - } else { - $.each(options.data, dayAddEvent); - } - } - } - - draw(); - } - - ; - (function(defaults, $, window, document) { - $.extend({ - calendar: function(options) { - return $.extend(defaults, options); - } - }).fn.extend({ - calendar: function(options) { - options = $.extend({}, defaults, options); - return $(this).each(function() { - var $this = $(this); - calendar($this, options); - }); - } - }); - })({ - days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], - months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], - date: (new Date()), - daycss: ["c-sunday", "", "", "", "", "", "c-saturday"], - todayname: "Today", - thismonthcss: "current", - lastmonthcss: "outside", - nextmonthcss: "outside", - mode: "month", - data: [] - }, jQuery, window, document); -})(jQuery); - -var data = [] -//data must be sorted by start date - -//Actually do everything -$('#holder').calendar({ - data: data -}); diff --git a/logging/static/less/style.less b/logging/static/less/style.less deleted file mode 100644 index f9933db..0000000 --- a/logging/static/less/style.less +++ /dev/null @@ -1,79 +0,0 @@ -@daywidth: 100px; - -//from bootstrap variables: - -@state-success-text: #3c763d; -@state-success-bg: #dff0d8; -@state-info-text: #31708f; -@state-info-bg: #d9edf7; -//@state-warning-text: #8a6d3b; -//@state-warning-bg: #fcf8e3; -//@state-danger-text: #a94442; -//@state-danger-bg: #f2dede; - - -.calendar-day { - width: @daywidth; - min-width: @daywidth; - max-width: @daywidth; - height: 80px; -} -.calendar-table { margin: 0 auto; width: @daywidth * 7;} - -.selected { background-color: #eee;} -.outside .date {color: #ccc; } -.timetitle { - white-space: nowrap; - text-align: right; -} - -.colors(@color, @text) { - @top: @color; - @border: darken(@color, 15%); - @bottom: darken(@color, 7.5%); - border-top: 1px solid @border; - border-bottom: 1px solid @border; - background-image: linear-gradient(to bottom, @top 0px, @bottom 100%); - background-repeat: repeat-x; - color: @text; - border-width: 1px; - - &.begin { - border-left: 1px solid @border; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; } - &.end { - border-right: 1px solid @border; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - } -} - -.event { - .colors(@state-success-bg, @state-success-text); - font-size: .75em; - padding: 0 .75em; - line-height: 2em; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - margin-bottom: 1px; - &.all-day { .colors(@state-info-bg, @state-info-text); } - &.clear { background: none; border: 1px solid transparent; } -} - - -.cell-styles(@ruleset) { - & > thead > tr, & > tbody > tr, & > tfoot > tr { - & > th, & > td { - @ruleset(); - } - } -} - -.table-tight { - .cell-styles({ padding-left: 0; padding-right: 0; }); -} -.table-tight-vert { - .cell-styles({ padding-top: 0; padding-bottom: 0; }); -} \ No newline at end of file From 8fc63429c09a84876c7c60ec1ba03e43e85b9bd0 Mon Sep 17 00:00:00 2001 From: Vipul Date: Fri, 18 Aug 2017 00:20:08 +0530 Subject: [PATCH 7/7] Fix: PEP 8 compliant code --- bot.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/bot.py b/bot.py index 30b5470..54eed51 100644 --- a/bot.py +++ b/bot.py @@ -3,14 +3,16 @@ import datetime from dateutil import tz -#use four space indentation only +# use four space indentation only from_zone = tz.gettz('UTC') to_zone = tz.gettz('Asia/Kolkata') + def msg_wrapper(): return "PRIVMSG " + channel + " " + def ping(): # responds to server pings ircsock.send("PONG :pingis\n") @@ -24,10 +26,12 @@ def joinchan(chan): def welcome(): - ircsock.send(msg_wrapper() + ":Hello! " + user+ " Welcome to jec-dev! Please introduce yourself with name, branch, sem, and area of interest \n ") + ircsock.send(msg_wrapper() + ":Hello! " + user + " Welcome to jec-dev! Please introduce yourself with name, branch, sem, and area of interest \n ") + + def hello(): - ircsock.send(msg_wrapper() + ":Hello! Welcome to jec-dev! Happy Hacking! :D\n") - + ircsock.send(msg_wrapper() + ":Hello! Welcome to jec-dev! Happy Hacking! :D\n") + if __name__ == '__main__': server = "irc.freenode.net" @@ -40,14 +44,14 @@ def hello(): ircsock.setblocking(False) - ircsock.send("USER " + botnick + " " + botnick + " " + + ircsock.send("USER " + botnick + " " + botnick + " " + botnick + " Test Bot\n") # user authentication # here we actually assign the nick to the bot ircsock.send("NICK " + botnick + "\n") joinchan(channel) - - with open("user_list_file",'rb') as usernames: + + with open("user_list_file", 'rb') as usernames: user_list = usernames.read().split('\n') while 1: @@ -64,7 +68,6 @@ def hello(): if ircmsg.find(":Hello " + botnick) != -1: hello() - if ircmsg.find('PING') != -1: ping() else: @@ -76,7 +79,7 @@ def hello(): if user not in user_list: welcome() user_list.append(user) - with open("user_list_file" , 'a') as usernames: + with open("user_list_file", 'a') as usernames: usernames.write(user+'\n') time.sleep(2) except Exception: