Giter VIP home page Giter VIP logo

jodelstats's Introduction

Jodel Stats

This is the source code for jodelstats.com, which is a small web app that shows the most popular posts on Jodel in Germany everywhere in the world.

How does this web app work?

This web app communicates with the Jodel servers to obtain the most popular posts in various cities. The city names and coordinates are saved in the database. The front end is just some Bootstrap magic.

I want feature X!

If you have any suggestions or if you would like to reach out to me, feel free to message me on Twitter or send me an e-mail.

Can I contribute to this thing?

Yes, of course! The process is as follows:

  1. Fork this repository
  2. Push your changes
  3. Create a pull request

How to set up this project on your machine

Some steps of setting this project up on your machine are quite complicated, so I'll try to be very verbose.

Prerequisities: You need to have Ruby on Rails installed on your machine. (OS X or Linux). Provided that this is fulfilled, here's what you need to get started:

  1. Clone the project using git clone [email protected]:ppati000/jodelstats && cd jodelstats
  2. Run bundle install --without production
  3. Tun bundle exec rake db:migrate
  4. Start the server using rails s
  5. Next, we need to get an access token as well as a refresh token for Jodel's API. I have found no programmatic way to create new Jodel accounts yet as they seem to use HMAC authorization for that. Note: This is a complicated step, but as soon as this is done the web app will fetch new API keys automatically before they expire.
  6. For Pros: See section below (Obtaining API Tokens)
  7. For everyone who does not have that much time to waste: Just send me an email and I'll take care of it.
  8. Run rails c to fire up the rails console
  9. Run ApiKey.create(token: "YOUR_ACCESS_TOKEN", refresh_token: "YOUR_REFRESH_TOKEN", current_client_id: "YOUR_CURRENT_CLIENT_ID", distinct_id: "YOUR_DISTINCT_ID", replacing all the placeholders with the values you obtained in the step before (or the values I sent you)
  10. To see if everything worked, run JodelCityController.update_api_token. The last line of output should be => true. If you get an error instead, at least one value supplied is invalid.
  11. Add a test city: JodelCity.create(name: "Karlsruhe", latitude: "49.01", longitude: "8.34", country: "DE")
  12. Open your browser on http://localhost:3000/ and you should see the test city.
  13. Now you're on your own! Have fun playing around!

Obtaining API Tokens (for Pros)

Obtaining a new Jodel account works as follows (using the iOS Client here). If you do not use the Jodel App on your device, you can skip steps 1 and 2.

  1. Create a backup of your device
  2. Restore your device using iTunes or reset all contents and settings
  3. Download Jodel app
  4. Connect your device to mitmproxy on your computer
  5. Start and set up the app
  6. Kill the app, set your device's date to at least 8 days from now, reopen the jodel app and look for a "refreshToken" request in mitmproxy (if you see two requests, use the second/later one)
  7. Store/write down the following values somewhere. From the request body: current_client_id, distinct_id, refresh_token, and from the response body: access_token
  8. Congratulations! You now have all the data for the Jodel API
  9. Restore your device from backup to get back your old Jodel account :)

Todo

  • Fix API Keys (API Keys are currently invalidated after 1 week, and fetching new API keys needs to be implemented) Edit: The app can now fetch new API keys, but only if a valid API key already exists in the database. You should never use API keys belonging to the same Jodel account for different environments, or else one environment will at some point update the API key, leaving the other environment with the old, now invalid API key.
  • Internationalization
  • Bug fixes?
  • Anything else you like

jodelstats's People

Contributors

ppati000 avatar

Watchers

 avatar  avatar

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.