Code Monkey home page Code Monkey logo

nitter's Introduction

Nitter

Test Matrix Test Matrix License

A free and open source alternative Twitter front-end focused on privacy and performance.
Inspired by the Invidious project.

  • No JavaScript or ads
  • All requests go through the backend, client never talks to Twitter
  • Prevents Twitter from tracking your IP or JavaScript fingerprint
  • Uses Twitter's unofficial API (no rate limits or developer account required)
  • Lightweight (for @nim_lang, 60KB vs 784KB from twitter.com)
  • RSS feeds
  • Themes
  • Mobile support (responsive design)
  • AGPLv3 licensed, no proprietary instances permitted

Liberapay: https://liberapay.com/zedeus
Patreon: https://patreon.com/nitter
BTC: bc1qp7q4qz0fgfvftm5hwz3vy284nue6jedt44kxya
ETH: 0x66d84bc3fd031b62857ad18c62f1ba072b011925
LTC: ltc1qhsz5nxw6jw9rdtw9qssjeq2h8hqk2f85rdgpkr
XMR: 42hKayRoEAw4D6G6t8mQHPJHQcXqofjFuVfavqKeNMNUZfeJLJAcNU19i1bGdDvcdN6romiSscWGWJCczFLe9RFhM3d1zpL

Roadmap

  • Embeds
  • Account system with timeline support
  • Archiving tweets/profiles
  • Developer API

Resources

The wiki contains a list of instances and browser extensions maintained by the community.

Why?

It's impossible to use Twitter without JavaScript enabled. For privacy-minded folks, preventing JavaScript analytics and IP-based tracking is important, but apart from using a VPN and uBlock/uMatrix, it's impossible. Despite being behind a VPN and using heavy-duty adblockers, you can get accurately tracked with your browser's fingerprint, no JavaScript required. This all became particularly important after Twitter removed the ability for users to control whether their data gets sent to advertisers.

Using an instance of Nitter (hosted on a VPS for example), you can browse Twitter without JavaScript while retaining your privacy. In addition to respecting your privacy, Nitter is on average around 15 times lighter than Twitter, and in most cases serves pages faster (eg. timelines load 2-4x faster).

In the future a simple account system will be added that lets you follow Twitter users, allowing you to have a clean chronological timeline without needing a Twitter account.

Screenshot

nitter

Installation

Dependencies

  • libpcre
  • libsass
  • redis

To compile Nitter you need a Nim installation, see nim-lang.org for details. It is possible to install it system-wide or in the user directory you create below.

To compile the scss files, you need to install libsass. On Ubuntu and Debian, you can use libsass-dev.

Redis is required for caching and in the future for account info. It should be available on most distros as redis or redis-server (Ubuntu/Debian). Running it with the default config is fine, Nitter's default config is set to use the default Redis port and localhost.

Here's how to create a nitter user, clone the repo, and build the project along with the scss and md files.

# useradd -m nitter
# su nitter
$ git clone https://github.com/zedeus/nitter
$ cd nitter
$ nimble build -d:release
$ nimble scss
$ nimble md
$ cp nitter.example.conf nitter.conf

Set your hostname, port, HMAC key, https (must be correct for cookies), and Redis info in nitter.conf. To run Redis, either run redis-server --daemonize yes, or systemctl enable --now redis (or redis-server depending on the distro). Run Nitter by executing ./nitter or using the systemd service below. You should run Nitter behind a reverse proxy such as Nginx or Apache for security and performance reasons.

Docker

Page for the Docker image: https://hub.docker.com/r/zedeus/nitter

NOTE: For ARM64 support, please use the separate ARM64 docker image: zedeus/nitter:latest-arm64.

To run Nitter with Docker, you'll need to install and run Redis separately before you can run the container. See below for how to also run Redis using Docker.

To build and run Nitter in Docker:

docker build -t nitter:latest .
docker run -v $(pwd)/nitter.conf:/src/nitter.conf -d --network host nitter:latest

Note: For ARM64, use this Dockerfile: Dockerfile.arm64.

A prebuilt Docker image is provided as well:

docker run -v $(pwd)/nitter.conf:/src/nitter.conf -d --network host zedeus/nitter:latest

Using docker-compose to run both Nitter and Redis as different containers: Change redisHost from localhost to nitter-redis in nitter.conf, then run:

docker-compose up -d

Note the Docker commands expect a nitter.conf file in the directory you run them.

systemd

To run Nitter via systemd you can use this service file:

[Unit]
Description=Nitter (An alternative Twitter front-end)
After=syslog.target
After=network.target

[Service]
Type=simple

# set user and group
User=nitter
Group=nitter

# configure location
WorkingDirectory=/home/nitter/nitter
ExecStart=/home/nitter/nitter/nitter

Restart=always
RestartSec=15

[Install]
WantedBy=multi-user.target

Then enable and run the service: systemctl enable --now nitter.service

Logging

Nitter currently prints some errors to stdout, and there is no real logging implemented. If you're running Nitter with systemd, you can check stdout like this: journalctl -u nitter.service (add --follow to see just the last 15 lines). If you're running the Docker image, you can do this: docker logs --follow *nitter container id*

Contact

Feel free to join our Matrix channel. You can email me at [email protected] if you wish to contact me personally.

nitter's People

Contributors

110percent avatar acarasimon96 avatar alefvanoon avatar amolith avatar b0pol avatar datanomi avatar decoy-walrus avatar duxovni avatar firemasterk avatar girst avatar heavenvolkoff avatar hookedbehemoth avatar jackyzy823 avatar lainlayer avatar nopdotcom avatar perflyst avatar peterdavehello avatar privacydevel avatar ringabout avatar rustybird avatar ryankoppenhaver avatar setenforce0 avatar solitudesf avatar thefrenchghosty avatar tommytran732 avatar unixfox avatar wasi-master avatar whizanth avatar yoshiyoshyosh avatar zedeus 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  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

nitter's Issues

Proxy images

Currently images like banner / profile image or media is not proxied and if you wanna view it, it redirects to Twitter.

Nitter random crashes (segfaults, index out of bounds)

Hello,

We are hosting the nitter.42l.fr instance and we're recently having trouble with it.

Nitter randomly stops working with the "Illegal storage access" error message, indicating a segmentation fault.
Sometimes, we also encounter the "index out of bounds" error, which also forces nitter to stop.

We couldn't accurately find a correlation between the accessed pages and the crashes. It seems to be quite random, but a deeper investigation is needed.

We can't guess if those crashes are caused by a recent commit or not, since we do not have enough traffic to tell the difference.

We have some hints:

  • It might be related to the crawlers wave we've recently gone through due to a misconfiguration in our robots.txt file ; a bot was crawling Twitter though our instance, generating heavy traffic.
  • Due to that traffic, a lot of cache entries has been generated (250+MB). In order to remove cached data and regain disk space, we've stopped the instance, deleted cache.db and the tmp/ folder and restarted it ; we might do it again if the cache gets too big (is it possible to set a maximum cache size?).
  • The Nitter instance is sending a lot of DNS queries (A? and AAAA? to api.twitter.com).
    What happens if the DNS resolvers returns an error because of too many queries at once on the same domain? (we're talking about 100+ requests per second for the same domain, some kind of random peaks when the instance is queried) Isn't nitter caching DNS queries' result ? This specific container is using the Quad9 DNS resolver.
  • During our tests, we've noticed that the Nitter instance started consuming all its reserved RAM (150MB), even though it's usually consuming around 3MB. We've noticed that behavior once, but it might be related to its strange behavior.

Technical information

We are running the latest version of Nitter (latest commit in the master branch).

  • The service is run within Docker 19.03.2 as a non-root user.
  • The container was set as read-only (with read and write rights for its working directory only), but we've unset it in order to ensure a good test environment. The segfaults / errors are still as numerous as before, though.
  • For now, the container restarts automatically when Nitter segfaults.
  • The instance is running under a reverse proxy (nginx) using a similar configuration as yours.

Feel free to try crashing our instance; don't bother to ask us nginx access logs for your specified IPs if needed.

Attaching a screenshot of the container logs. We've censored the container's local IP.
nitter-sigsegv

Thanks for your wonderful work!

Add a webpage for unimplemented features

Hi!

When an user is trying to redirect a twitter link to an unimplemented feature, she/he is redirected to a 404 error.
That would be great if, instead, users could be redirected to a special webpage for unimplemented features, saying something like "Nitter is WIP. The feature you're trying to access is not currently supported but it's on our plan. You can check what is our TODO list here."

This way, third parties would not have to take care about which URL the user is trying to redirect and then they would not have to check all implemented features and how the project is growing day after day.

Finally, that would let the user know they are not facing a bug and that humans are working on the project. (You could use this same webpage to display informations like where to submit a bug, where to talk with the community arround Nitter, where to donate, etc.)

iOS Shortcut for Twitter Redirecting

I couldn't find a contact email for you @zedeus, so I'm just putting this here as an FYI in case it helps anyone. Please feel free to close this issue.

On iOS there's a capability called "Shortcuts":

A shortcut is a quick way to get one or more tasks done with your apps. The Shortcuts app lets you create your own shortcuts with multiple steps. - https://support.apple.com/guide/shortcuts/welcome/ios

So here's a shortcut for redirecting Twitter URLs to Nitter URLs 😄 (inspired by this Invidious shortcut):

This shortcut opens the Nitter URL in Firefox but can be configured for any browser that has its own URL Scheme, for example:

Really loving Nitter! Awesome work!

Proper database support

I know you are currently waiting of moigagoo/norm#19 but this adds MongoDB which is probably not the best database for this kind of caching.

Why not just using PostgreSQL? If MongoDB is just for caching than okay, this will work fine. But if you add user account and following support (maybe also liking etc) I do not think MongoDB is the correct choice.

Some status links don't redirect

Hello, I've found that some status links (e.g. https://twitter.com/elonmusk/statuses/1158968745227780096) don't redirect to nitter.net correctly (https://nitter.net/elonmusk/statuses/1158968745227780096), but changed links (https://twitter.com/elonmusk/status/1158968745227780096) do (https://nitter.net/elonmusk/status/1158968745227780096).
P.S. I don't know is this a problem of Nitter by itself or just nitter.net website, so sorry if it's not a place for this thread.

Ability to click on the tweet to get it opened

Currently you need to click on the timestamp to get the full tweet with replies. This is not very user-friendly.
If you can click anywhere on the Tweet it would be much easier and user-friendlier.

Display version of the software

I would love to know which version of Nitter is actually being used.
Invidious provides the hash of the commit in the footer. Maybe you could do something similar in the footer or about page.

Add logfile support

Add simple logfile support with a parameter.

For example ./nitter -o nitter.log

Red on black isn't the best thing to read

In my opinion having Red text on a black (or any) background isn't really the best thing to read, you should have every text in white (or gray) while keeping red as the second color of the UI (like the line under "Tweet" for example)

nitter

Responsive design (mobile friendly)

Currently nitter looks on mobile the same as on desktop and you need to zoom manually otherwise you cannot read anything.

Would it be possible to make nitter more responsive and mobile friendly?

RSS tested, only 1 missing feature

I did some more testing with the RSS and the only thing missing is the fact that the author field does not contain a link to the nitter author page

Invidious implemented it like that:

    <author>
      <name>Linus Tech Tips</name>
      <uri>https://invidio.us/channel/UCXuqSBlHAE6Xw-yeJA0Tunw</uri>
    </author>

While you use:

     <dc:creator>@elonmusk</dc:creator>

According to http://www.rssboard.org/rss-profile#namespace-elements-dublin-creator there is a limitation in <dc:creator> so you need to use <author\>

Otherwise everything else is perfect and RSS appears to be feature complete

Show Twitter trends

I dont know if you have a solution for geo based trends but at least the "Worldwide trends" could be shown.

Privacy policy for nitter.net and the nitter project

Right now nitter.net (and the whole nitter project) don't have any privacy policy, for a privacy focused project this is really needed considering how much people use privacy as a marketing argument (See OkunaOrg/okuna-www#120 for the worst example of a project that literally censor people that talk about it (they locked their issues to contributors only after I posted that, amazing for a "ethical" project)).

Support for more languages

As a translator I would happily translate nitter in french (and I'm sure other people will happily translate it to other languages too) if you add support for it.

Increase SSL/ TLS security

SSLLabs.com give you a "B" (A is best) rating because this server does not support Forward Secrecy.
https://www.ssllabs.com/ssltest/analyze.html?d=nitter.net

Mozilla's observatory even give a "F" because of missing Content Security Policy (CSP), missing HTTP Strict Transport Security (HSTS) and missing HTTP headers like X-XSS-Protection
https://observatory.mozilla.org/analyze/nitter.net

Webbkoll confirm that: https://webbkoll.dataskydd.net/en/results?url=http%3A%2F%2Fnitter.net

Reduce the wasted space on the screen

nitter

In my opinion the wasted space on the side of the content is too big, it's great for phones use but on a PC it's really too much, in my opinion you should align the left column to the left of the page and increase the size of the content, in theory it should still act the same on phones.

Communication platform

This project already got some attentation in the Invidious Matrix room / IRC and it would be nice if there also would be some room or platform for Nitter discussion.

Do you also use Matrix? Anything else which could be used?
If you want I can take care about all this (the room and bots etc), I also do this in Invidious Matrix room / IRC.

Move nitter specific things to subdirectory

Nitter settings and info currently could also be an user. What if I wanna visit a user called "settings"?
I wouldnt move the users because Twitter uses twitter.com/username, what about

nitter.net/.nitter/settings or similar?

Censored Tweets

This tweet https://twitter.com/ShahakShapira/status/1168900522092441600 is censored in germany

Nitter just says "Tweet not found"

DEBUG GET /ShahakShapira/status/1168900522092441600
DEBUG PRAGMA foreign_keys = ON
DEBUG SELECT id, videoId, contentId, durationMs, url, thumb, views, available, reason, playbackType FROM video WHERE videoId = ? <- ''
DEBUG   404 Not Found {"content-type": @["text/html;charset=utf-8"]}
DEBUG GET /css/style.css
DEBUG   304 Not Modified {:}
DEBUG   -> public/css/style.css
DEBUG   TCActionRaw
DEBUG GET /css/fontello.css
DEBUG   304 Not Modified {:}
DEBUG   -> public/css/fontello.css
DEBUG   TCActionRaw
DEBUG GET /logo.png
DEBUG   304 Not Modified {:}
DEBUG   -> public/logo.png
DEBUG   TCActionRaw
DEBUG GET /fonts/fontello.woff2
DEBUG   304 Not Modified {:}
DEBUG   -> public/fonts/fontello.woff2
DEBUG   TCActionRaw

Please either show some information that the tweet is censored or circumvent the censoring.

Start video only if focus (or play button)

At the moment all videos start playing automatically. This can slow down the browser tab if there a lot of videos.
I would like to have a play button or autoplay only on focus (with mouse pointer).

This could also be configureable, time for settings? ;)

Create issues for each ToDo

Tracking todos in a readme is not very nice because people who are interested in this project dont get notifications on updates.

Enable hls playback broken

https://nitter.snopyta.org/Ad_Inifinitum/status/1168670340198928385

Enabling HLS does not work with latest commit on master. It somehow works on nitter.net, do you run unpublished commits?

Sep 04 08:11:48 nitter nitter[23443]: DEBUG GET /fonts/fontello.woff2
Sep 04 08:11:48 nitter nitter[23443]: DEBUG   200 OK {"etag": @["0988e2b35116883eec2a931b7c7cfa03"], "content-type": @["font/woff2"]}
Sep 04 08:11:48 nitter nitter[23443]: DEBUG   -> public/fonts/fontello.woff2
Sep 04 08:11:48 nitter nitter[23443]: DEBUG   TCActionRaw
Sep 04 08:11:48 nitter nitter[23443]: DEBUG   200 OK {"content-type": @["video/mp4"]}
Sep 04 08:11:48 nitter nitter[23443]: DEBUG GET /favicon.ico
Sep 04 08:11:48 nitter nitter[23443]: DEBUG   404 Not Found {"content-type": @["text/html;charset=utf-8"]}
Sep 04 08:11:48 nitter nitter[23443]: DEBUG POST /enablehls
Sep 04 08:11:48 nitter nitter[23443]: DEBUG PRAGMA foreign_keys = ON
Sep 04 08:11:48 nitter nitter[23443]: DEBUG INSERT INTO prefs (hlsPlayback, mp4Playback, proxyVideos, muteVideos, autoplayGifs, hideTweetStats, hideBanner, stickyProfile, replaceYouTube, replaceTwitter) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) <- 1, 1, 1, 0, 1, 0, 0, 1, 'invidio.us', 'nitter.snopyta.org'
Sep 04 08:11:48 nitter nitter[23443]: DEBUG   303 See Other {"set-cookie": @["preferences=9; Expires=Sat, 29 Aug 2020 08:11:47 GMT; Secure; HttpOnly; SameSite=Lax"], "location": @[""]}
Sep 04 08:11:48 nitter nitter[23443]: DEBUG GET /enablehls
Sep 04 08:11:48 nitter nitter[23443]: DEBUG PRAGMA foreign_keys = ON
Sep 04 08:11:48 nitter nitter[23443]: DEBUG SELECT id, hlsPlayback, mp4Playback, proxyVideos, muteVideos, autoplayGifs, hideTweetStats, hideBanner, stickyProfile, replaceYouTube, replaceTwitter FROM prefs WHERE id = ? <- '9'
Sep 04 08:11:48 nitter nitter[23443]: DEBUG PRAGMA foreign_keys = ON
Sep 04 08:11:48 nitter nitter[23443]: DEBUG SELECT id, username, fullname, location, website, bio, userpic, banner, following, followers, tweets, likes, media, verified, protected, joinDate, updated FROM profile WHERE lower(username) = ? <- 'enablehls'
Sep 04 08:11:48 nitter nitter[23443]: DEBUG PRAGMA foreign_keys = ON
Sep 04 08:11:48 nitter nitter[23443]: DEBUG SELECT id, username, fullname, location, website, bio, userpic, banner, following, followers, tweets, likes, media, verified, protected, joinDate, updated FROM profile WHERE lower(username) = ? <- ''
Sep 04 08:11:48 nitter nitter[23443]: DEBUG   404 Not Found {"content-type": @["text/html;charset=utf-8"]}

Respect newlines in bios

Twitter bios can contain the \n character. At the moment, Nitter puts the newlines in the source. I think it should convert them to <br>

For example, mine is currently:

<div class="profile-bio"><p>Digital Troublemaker
Long haired Ⓥ geek
He/Him
&amp;: ...

It should be

<div class="profile-bio"><p>Digital Troublemaker<br>
Long haired Ⓥ geek<br>
He/Him<br>
&amp;: ...<br>

I'm not familiar with nim, but I think the issue is at https://github.com/zedeus/nitter/blob/master/src/views/profile.nim#L28 which calls linkifyText() at https://github.com/zedeus/nitter/blob/master/src/formatters.nim#L78

Or, you can add white-space: pre-wrap; to the bio. Which is how Tweets are rendered.

hyperlinks for hashtags with umlauts are broken

The search for hashtags oder regular content containing umlauts works fine, but the hyperlinks for such hashtags are broken.

as one can see in the screenshot, clicking on #Privatsphäre will search for #Privatsph:

nitter_screenshot

Searching for Tweets not working

Searching for "test" and clicking on "Tweets" on the left side is not working on nitter.snopyta.org nor nitter.42l.fr. It somehow is working on nitter.net.

Doing this search results in thousands of DNS queries to api.twitter.com.

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.