Giter Site home page Giter Site logo

alisa-yar / source-code-viewer Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 466 KB

Online Source Code Viewer (get HTML source code from URL)

Home Page: https://source-code-django.vercel.app

Python 44.22% HTML 25.64% Shell 0.53% CSS 26.09% JavaScript 3.52%
django django-application django-project source-code source-code-viewer urllib web-scraping web-scraping-python html-source inspector

source-code-viewer's Introduction

Source Code Viewer Web Application (Django)

This website gets a url and returns the HTML (source code) of the website.

https://source-code-django.vercel.app

(5.8.23) I decided to move this project to Flask instaed of Django for more flexability and convenience)

(3.8.23) The issues were fixed (somehow). The 403 error was fixed by not using the 'urllib' library and using the 'requests' library instead for the web scraping (or at least that's what I think), and it seems to work even when my cookies are disabled.

(I still haven't fixed: the 403 error for some websites and that it don't work without cookies😅)

This code doesn't work on vercel (yet) so I copy-pasted my code to their Django template so it would deploy. I need to rewrite this code but for now its running here: https://django-source-code.vercel.app/

How to use?

$ python manage.py runserver
go to http://127.0.0.1:8000/

To Do:

  1. style the html files with separate CSS file (how to add CSS to Django?)
  2. beautify the output HTML ✔️
  3. Publish it (?) if it isn't expensive ✔️
  4. Fix the code so it'll work with: diabled cookies, websites that return 403 error
  5. Add tests
  6. Add the url that was given in the input to the output url (/output/https://google.com)
  7. display a message insted of an error when the user tries to enter '' (empty string).

How to create Django project from Macbook terminal?

$ cd Desktop
$ mkdir sourcecode
$ cd sourcecode
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pipenv install django
$ pipenv install urllib3
$ pipenv install bs4
$ pipenv install beautifulsoup4
$ pipenv install requests
$ code . (or open the new project in vscode)
$ pipenv shell
$ django-admin startproject sourcecode .
$ python manage.py startapp inspector

$ pip freeze > requirements.txt

notes
notes

source-code-viewer's People

Contributors

alisa-yar avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

zhukov-z

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.