Git Product home page Git Product logo

dwitter's Introduction

dwitter

A platform to write visual art in javascript limited to 140 characters.

The frontend is currently being rewritten, so please direct frontend development to dwitter-frontend. The new frontend is currently hosted at beta.dwitter.net.

Available on dwitter.net

Join the chat on Discord

license

Inspired by arkt.is/t/

Pre-requisites and first-time installation

  • Install npm
  • sudo apt install npm
  • Get packages needed for server and clone the repository
  • sudo apt install git virtualenv python-pip
  • git clone https://github.com/lionleaf/dwitter.git

Setup

Linux

  1. make setup (set up virtual environment)
  2. source venv/bin/activate (activate virtual environment)
  3. make (install dependencies and set up database)
  4. python manage.py createsuperuser (create admin account used below)
  5. make run runs the server. Use make serve instead if you're working inside a VM with port forwarding. (0.0.0.0:8000)
  6. Go to http://localhost:8000/admin/sites/ and log in with admin account created above.
  7. Click on the one entry, and change both domain name and display name to localhost:8000.
  8. Make sure http://dweet.localhost:8000/ returns a django error. May not work in Firefox.

Windows

  1. Download the latest python3.7 release.
  2. Without installing the setup, extract all the files in the a new directory such as ./python37
  3. Set up virtual environment using the extracted interpreter: virtualenv --python ./python37/python.exe venv
  4. Activate the venv: cd venv/Scripts && activate.bat
  5. Get back in the main directory (cd ../.. && make) and use make command (install dependencies and set up database)
  6. Continue with the fourth step from Linux setup.

Other commands

  • make migrations
  • make migrate
  • make lint
    • lints Python and JS files
    • automatically fixes some JS issues (mostly whitespace-related)
  • make shell
  • make backup
  • make restore-backup

Dwitter API

Dweets

GET www.dwitter.net/api/dweets/  - list of the last 10 dweets

       ?limit=100            - number of results to return, default 10, max 100 (subject to change)
       &offset=200           - offset page by 200 dweets
       &remix_of=123         - all remixes of 123
       &author=lionleaf      - dweets by author


GET www.dwitter.net/api/dweets/123  - get details about d/123

Latest dweet: https://www.dwitter.net/api/dweets/?limit=1 (sorted by posted date by default)

Users

GET dwitter.net/api/users/lionleaf  - Show details about user 'lionleaf'.

dwitter's People

Contributors

aleksanb avatar anheurystics avatar annanfay avatar atesgoral avatar balintcsala avatar cristeahub avatar dependabot[bot] avatar diceroll123 avatar dwitterer avatar epicorange avatar fujimotos avatar gnocchi2815 avatar imscary avatar iver56 avatar jellyedwards avatar joeytwiddle avatar lionleaf avatar moonrisewarrior avatar pavelb avatar prplz avatar pythech avatar rep-movsd avatar sethjust avatar sigvef avatar srmcgann avatar stianjensen avatar tbroadley avatar thomasbrierley avatar veu avatar whackashoe 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dwitter's Issues

Prevent duplicates

If a user tries to submit a dweet that already exists (i.e. the code is the same), then that dweet should not be accepted as a new dweet, and the user should get a message explaining why

Rank top users

Have a list of users with top accumulated "awesome"? And/or average "awesome" / number of dweets?

After posting a new dweet, see share-link

When a user posts a new dweet he should receive some kind of positive message about the new dweet. F.ex. "Great! If you want to show off your new dweet, share the following link:"
<shareable link>

Update dweet (post new revision)

I often find myself wanting to refine a dweet I already posted. For example I want to make them shorter, faster or fix a visual bug. I want to update my existing dweet instead of deleting the old obsolete dweet and posting the refined version as a new dweet. This is because I don't want to lose the likes the dweet had and i also don't want to break the shareable link the dweet had

Completely unload dweets that are outside the screen

Even though dweets stop running, they still fill up memory, after scrolling through a couple I easily hit 1GB memory usage on a dwitter tab. Solution would be to free/unload dweets after they have been scrolled away from (say 2 dweets out of screen)

Problem with newlines on Windows

In a dweet like http://dweet.dwitter.net/id/246 I used newlines instead of ; for readability purpose.

Problem 1: I am on Windows, hitting Return on a textarea apparently inserts a CRLF. So the site counts 2 characters instead of 1, which isn't economical... :-/
Somehow, there should be a replacement of CRLF by LF internally (and back, if needed).

Problem 2: HTML of textarea forces row="3", so I can't resize the area (on Chrome, at least).

Problem 3: HTML relies on maxlength="140" to ensure the dweet is legal, but as said, it counts end of lines on Windows as two chars. If JS can't fix s/CRLF/LF/, perhaps the limit should be enforced by JS only? With special handling of CRLF sequence, of course.

Problem 4: character counter counts EOL as one char, so we can be stuck at 136/140 when we have 4 EOLs... Puzzling at first.

Make a reply-system

Replies should also be demos. Perhaps let a user play with any dweet with the option to post it as a reply

Handle link is wrong

For example, if Froff comments a dweet by lionleaf, the username Froff will become a link that leads to lionleaf's page. Expected behavior: Link leads to Froff's page.

This is not a problem for comments that are placed in the DOM by JS

Make infinite scroll more obvious

Should be a "loading ... " when at the bottom to indicate that more items are about to load.

Also consider a fall-back link to manually load more

Infinite scroll is broken

Behavior in Chrome: Infinite scroll doesn't work at all
Behavior in FireFox: Infinite scroll loads one new page, but not pages that should come after that

Comment field becomes red after submit

After I submit a comment and the field is automatically cleared, validation kicks in and the field becomes red (browser: Firefox). This isn't a defect per se, but it's slightly distracting.

bilde

If one could reset the form into a "pristine" state after submit, that would probably fix the issue.

Or maybe the novalidate attribute could help? http://stackoverflow.com/a/31170547/2319697

Page: Getting started

Add a page that explains how to get started

  • Some basic techniques (how to draw a filled rectangle, a line, an arc, how to color them, how to draw multiple things, how to clear a frame etc.)
  • Examples of the techniques mentioned
  • A few words of advice on how to avoid getting in an "infinite loop" state (be careful when editing a for loop)

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.