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.
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.
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.
Yes, of course! The process is as follows:
- Fork this repository
- Push your changes
- Create a pull request
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:
- Clone the project using
git clone [email protected]:ppati000/jodelstats && cd jodelstats
- Run
bundle install --without production
- Tun
bundle exec rake db:migrate
- Start the server using
rails s
- 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.
- For Pros: See section below (Obtaining API Tokens)
- For everyone who does not have that much time to waste: Just send me an email and I'll take care of it.
- Run
rails c
to fire up the rails console - 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) - 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. - Add a test city:
JodelCity.create(name: "Karlsruhe", latitude: "49.01", longitude: "8.34", country: "DE")
- Open your browser on http://localhost:3000/ and you should see the test city.
- Now you're on your own! Have fun playing around!
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.
- Create a backup of your device
- Restore your device using iTunes or reset all contents and settings
- Download Jodel app
- Connect your device to mitmproxy on your computer
- Start and set up the app
- 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)
- 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
- Congratulations! You now have all the data for the Jodel API
- Restore your device from backup to get back your old Jodel account :)
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 (Swedish? French?)
- Pagination for the front page
- Make linking to searches possible. As of now, cities you search for become inaccessible after five minutes until you type and search the name again.
- Make refreshing cities atomic. As of now, all posts of a city are deleted before adding new posts.
- Anything else you like