oakleyaidan21 / clearForReddit

A mobile reddit client for ios and android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clear for Reddit

Clear is an open-sourced, cross-platform mobile application for browsing reddit.

So far, Clear is mostly contained to mass browsing, but features will be added as time goes on.

Setup

In order to run Clear yourself, you'll need to set it up like any other react-native application.

Android

Simply run npm install in the root directory

iOS

run npm install in the root directory, then run pod install in the ios directory

Creating a Reddit Application

For communicating with the reddit API, you'll need to create an application in your reddit account's preferences. Here's a link to doing so.

Once you have your apps userAgent, clientID, and refreshToken (helper here for retrieving that), put them each in a file within util/snoowrap titled snoowrapConfig.tsx. It should look like:

type Config = {
  userAgent: string;
  clientId: string;
  refreshToken: string;
};

const snoowrapConfig: Config = {
  userAgent: "USERAGENT", //a unique name for your app; you create this yourself
  clientId: "CLIENTID", //your clients id, found underneath the name of your application in your reddit account's app preferences
  refreshToken: "REFRESHTOKEN", //a refreshToken for creating a default account that unauthed users will use when they use the app without an account
};

export default snoowrapConfig;

Accessing imgur API

In order to get images from imgur in an album, you'll need to register for imgur api credentials. You can get those here. Select Anynymous usage without user authorization. Place your client id and client secret in util/imgur/ in a file called imgurConfig.tsx. It should look like this:

const imgurConfig: any = {
  clientID: "CLIENTID",
  clientSecret: "CLIENT SECRET",
};

export default imgurConfig;

Playing YouTube natively on Android

You'll need a google API key in order to play youtube videos in the app on android. You can find out how to get one here. Once you have a key, place it in util/youtube in a file titled youtubeConfig.tsx. It should look like this:

export const apiKey = "AIzaSyB56c605jONMlWRn0OzTTvLy6_p00Hgro4";

Current Features

  • sign users in
    • view subreddits and their posts
      • sort posts
    • view All/Popular posts
    • add/remove subscribed subreddits
    • view sub sidebars
    • save posts
    • view own user comments
  • search for posts or subs
  • view user pages
  • themeing (just light and dark)
  • imgur and gfycat integration
  • youtube integration
  • tablet version
  • can vote on posts

TO-DO (that I currently have thought of)

  • add ability to retrieve other sections of a user's page
  • add better UI
  • add comment/reply functionality
  • add report functionality
  • optimize post rendering
  • add swiper functionality to tablet version
  • add dynamic header to posts
  • improve styling
  • combine the two sorting types into one type

About

A mobile reddit client for ios and android


Languages

Language:TypeScript 49.7%Language:JavaScript 45.4%Language:Java 2.6%Language:Objective-C 1.7%Language:Ruby 0.3%Language:Starlark 0.2%