Code Monkey home page Code Monkey logo

jsmon's People

Contributors

robre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsmon's Issues

keep getting this errors and it wont work

i keep getting this erros affter i run jsmon

JSMon - Web File Monitor
Traceback (most recent call last):
  File "jsmon.py", line 144, in <module>
    main()        
  File "jsmon.py", line 132, in main
    ep_text = get_endpoint(ep)
  File "jsmon.py", line 42, in get_endpoint
    r = requests.get(endpoint)
  File "/home/zealsham/.local/lib/python3.6/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/home/zealsham/.local/lib/python3.6/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/zealsham/.local/lib/python3.6/site-packages/requests/sessions.py", line 516, in request
    prep = self.prepare_request(req)
  File "/home/zealsham/.local/lib/python3.6/site-packages/requests/sessions.py", line 459, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/home/zealsham/.local/lib/python3.6/site-packages/requests/models.py", line 314, in prepare
    self.prepare_url(url, params)
  File "/home/zealsham/.local/lib/python3.6/site-packages/requests/models.py", line 388, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL '# Ignore everything in this directory': No schema supplied. Perhaps you meant http://# Ignore everything in this directory?

Cant able to install setup.py

When I tried the following option python setup.py install it gives the following error

/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running install
running build
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/JSMon-1.0.egg-info
Writing /usr/local/lib/python2.7/dist-packages/JSMon-1.0.egg-info

In setup.py the following is the code

#!/usr/bin/env python
from setuptools import setup, find_packages

setup(
name='JSMon',
packages=find_packages(),
version='1.0',
description="A python script that monitors JavaScript files.",
long_description=open('README.md').read(),
author='r0bre',
author_email='[email protected]',
license='MIT',
url='https://github.com/robre/jsmon',
install_requires=['requests', 'jsbeautifier', 'python-decouple','slackclient'],
)

What's the problem ?

Thanks in advance !!
Yukesh

Is this tested using cronjob??

With cronjob configured as mentioned in readme, lets say @daily python3 /root/tools/jsmon/jsmon.py

this point of the code:

allendpoints = get_endpoint_list('targets')
print(allendpoints)   # endpoint will come as {} because targets is not in $HOME but in jsmon dir here: /root/tools/jsmon/

I am able to get it working by modifying to full path in jsmon.py but it is not flexible, not sure how can we check jsmon dir path and configure all paths in jsmon.py with that full path dynamically.

Here is some part of my change which I did to get it working with cronjob

-    oldlines = open("downloads/{}".format(old), "r").readlines()
-    newlines = open("downloads/{}".format(new), "r").readlines()
+    oldlines = open("/root/tools/jsmon/downloads/{}".format(old), "r").readlines()
+    newlines = open("/root/tools/jsmon/downloads/{}".format(new), "r").readlines()
     oldbeautified = jsbeautifier.beautify("".join(oldlines), opt).splitlines()
     newbeautified = jsbeautifier.beautify("".join(newlines), opt).splitlines()
     # print(oldbeautified)
@@ -123,8 +123,8 @@ def main():
         print("Please Set Up your Telegram Token And Chat ID!!!")
         exit(1)
         
-    allendpoints = get_endpoint_list('targets')
-    # print(allendpoints)
+    allendpoints = get_endpoint_list("/root/tools/jsmon/targets")
+    print(allendpoints)

Error traceback running have a look!

Traceback (most recent call last):
File "jsmon.py", line 144, in
main()
File "jsmon.py", line 132, in main
ep_text = get_endpoint(ep)
File "jsmon.py", line 42, in get_endpoint
r = requests.get(endpoint)
File "/home/faisal/.local/lib/python3.8/site-packages/requests/api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "/home/faisal/.local/lib/python3.8/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/home/faisal/.local/lib/python3.8/site-packages/requests/sessions.py", line 494, in request
prep = self.prepare_request(req)
File "/home/faisal/.local/lib/python3.8/site-packages/requests/sessions.py", line 427, in prepare_request
p.prepare(
File "/home/faisal/.local/lib/python3.8/site-packages/requests/models.py", line 305, in prepare
self.prepare_url(url, params)
File "/home/faisal/.local/lib/python3.8/site-packages/requests/models.py", line 379, in prepare_url
raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL '# Ignore everything in this directory': No schema supplied. Perhaps you meant http://# Ignore everything in this directory?

what is this? how to fix it? i am running it on my laptop having ubuntu 20.04

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.