Coder Social home page Coder Social logo

php-reddit-api's Introduction

Reddit

Gets information about a reddit user.

More Info:

cacheFeedData($filename, $feed_url, $time=null)

Takes the contents of a remote JSON file and stores it in a cache file. This file is refreshed every 360 seconds by default and can be changed with the $time parameter.

More Info:

  • Param: string $filename The name you choose for the cached file.
  • Param: string $feed_url The remote url of the feed to be cached.
  • Param: int $time The number of seconds to cache the file for. Default is 360 (6 minutes).
  • Access: public
  • Return: string The contents of the feed or file.

cakeDay()

Sets the Unix datetime of when the account was created if a value is passed, returns it if no value is passed.

More Info:

  • Param: int $val Sets the time.
  • Access: public
  • Return: int the Unix datetime in which the account was created.

commentKarma()

Sets the commentKarma if a value is passed, returns it if no value is passed.

More Info:

  • Param: int $val Sets the comment karma.
  • Access: public
  • Return: int the user's comment karma.

data()

Returns the data from the Reddit API.

More Info:

  • Access: public
  • Return: string the data returned from the Reddit API.

getDaysUntilCakeDay()

Uses the Unix datetime for account creation to determine when the next cake day will be.

More Info:

  • Access: public
  • Return: int Number of days until the user's cake day.

getFeedData($url)

Uses cURL to get the contents of the JSON API files.

More Info:

  • Param: string $url The URL of a file.
  • Access: public
  • Return: string The contents of the file passed in .

getRawJSON()

Outputs the raw JSON data received from the reddit api. This method is mainly used for debugging purposes.

More Info:

  • Access: public

hasMail()

Determines whether the user currently has mail.

More Info:

  • Param: boolean $val Sets the value.
  • Access: public
  • Return: boolean Whether the user has mail.

linkKarma()

Sets the linkKarma if a value is passed, returns it if no value is passed.

More Info:

  • Param: int $val Sets the link karma.
  • Access: public
  • Return: int the user's link karma.

username()

Sets the username if a value is passed, returns it if no value is passed.

More Info:

  • Param: string $val Sets the username.
  • Access: public
  • Return: string the username.

__construct($username)

  • Param: string $username The username of the reddit user.
  • Access: public

php-reddit-api's People

Contributors

devinclark avatar

Watchers

 avatar James Cloos avatar

Forkers

clentdc

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.