This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*************************************************************************** | |
* Class name: Reddit | |
* Description: Frankenstein combination of https://github.com/jcleblanc/reddit-php-sdk | |
* and https://gist.github.com/3845707 | |
* Goal: Expand on Flotwig's code to be able to use data only avalaible while logged in. | |
* Usage: | |
* $reddit->urlApi('message/inbox/') | |
***************************************************************************/ | |
class reddit{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dutch translation, most is correct. Might want a second opionion | |
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. | |
nl: | |
navigation: | |
headers: | |
general: "Algemeen" | |
information: "Informatie" | |
status: "Status" | |
rules: "Regels en Richtlijnen" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// example usage: | |
// redditApi('user/creesch'); will return an array with information about me | |
// redditApi('r/theoryofreddit'); will return an array of info about r/breakingbad | |
function redditApi($call,$domain='www.reddit.com') { | |
$url = 'http://' . $domain . '/' . $call; | |
if (function_exists('curl_init')) { // not all PHP installations have cURL | |
$ch = curl_init($url); | |
curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE); | |
curl_setopt($ch,CURLOPT_USERAGENT,'/u/creesch'); // Needed for stats and identifing scripts that do not behave, change to something to unique. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body .content .sitetable .thing.spam, body .sitetable .thing.spam.deleted.link.self { | |
border: solid 2px #FA8072 !important; | |
} | |
.comments-page .thing.spam > .entry { | |
display: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Next 4 sections make deleted messages less noticeable -djimbob*/ | |
form.grayed, form.grayed ~ ul.flat-list.buttons { display: none } | |
p.tagline > a.expand:first-child + em:after, div.collapsed > a.expand:first-child + em:after | |
{ | |
visibility: visible; | |
font-weight: bold; | |
content: "Comment deleted or removed" | |
} | |
p.tagline > a.expand:first-child + em, div.collapsed > a.expand:first-child + em |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name reddit.com - Realtime Reddit | |
// @namespace v2 | |
// @include *.reddit.com/r/*/about/unmoderated* | |
// @include *.reddit.com/r/*/about/probation* | |
// @include *.reddit.com/r/*/comments/ | |
// @include *.reddit.com/r/*/comments | |
// @include *.reddit.com/comments/ | |
// @include *.reddit.com/comments | |
// @include *.reddit.com/user/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.getJSON(jsonurl).done(function (data, status, jqxhr) { | |
console.log(status); | |
console.log(jqxhr.getAllResponseHeaders()); | |
console.log(jqxhr.getResponseHeader('x-ratelimit-remaining')); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.comments-page .comment .flat-list.buttons').each(function () { // this targets each flat-list belonging to comments on a comment page. | |
$(this).append('<li><a class="view-source" href="javascript:void(0)">view source</a></li>'); // it then adds the view sourc button in the belonging function | |
}); | |
$('body').on('click', '.view-source', function () { // On clicking of the view source button we do what we want to do. Note that we start with body since that is a constant dom element. If you try to target added dom elements directly it will not work. | |
var $this = $(this), // We posisbly want to reuse $(this), it is cleaner to define jquery objects you want to reuse. | |
$parentThing = $this.closest('.thing'), | |
thingId = $parentThing.attr('data-fullname'); // we need an id to throw at the api, luckily it is is present in the html. | |
if($parentThing.find('#box-' + thingId).length) { // Lets see if we already did do this before. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div#header-bottom-left { | |
padding-top: 20px; | |
} | |
#header-img { | |
max-height: 40px !important; | |
} | |
#header-img-a { | |
margin: 0 !important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.sitetable .thing.stickied { | |
border: dashed 10px rgb(255, 92, 0) !important; | |
outline: solid 5px red; | |
} | |
.sitetable .thing.stickied .title { | |
font-size: 45px !important; | |
} | |
.sitetable .thing.stickied .title a { | |
color: rgb(90, 165, 75) !important; | |
} |
OlderNewer