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
NSURL *markerURL = [NSURL URLWithString:@"https://api.app.net/posts/marker"]; | |
NSURLResponse *response = nil; | |
NSError *error = nil; | |
NSString *post = [NSString stringWithFormat:@"{ \"name\": \"channel:%d\", \"id\": \"%d\" }", channelID, mesageID]; | |
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; | |
NSString *postLength = [NSString stringWithFormat:@"%lu",(unsigned long)[postData length]]; | |
NSDictionary *headers = @{@"Content-Type" : @"application/json", @"Content-Length" : postLength}; | |
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:markerURL]; | |
request.HTTPMethod = @"POST"; | |
request.HTTPBody = postData; |
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
Freeman:~ max$ ayadn mentions @hutattedonmyarm | |
Daybreak database /Users/max/ayadn/hutattedonmyarm/db/users.db was not closed, state might be inconsistent | |
Daybreak database /Users/max/ayadn/hutattedonmyarm/pagination/index.db was not closed, state might be inconsistent | |
/Library/Ruby/Gems/2.0.0/gems/daybreak-0.3.0/lib/daybreak/journal.rb:100:in `initialize': Permission denied - /Users/max/ayadn/hutattedonmyarm/pagination/pagination.db (Errno::EACCES) | |
from /Library/Ruby/Gems/2.0.0/gems/daybreak-0.3.0/lib/daybreak/journal.rb:100:in `open' | |
from /Library/Ruby/Gems/2.0.0/gems/daybreak-0.3.0/lib/daybreak/journal.rb:100:in `open' | |
from /Library/Ruby/Gems/2.0.0/gems/daybreak-0.3.0/lib/daybreak/journal.rb:11:in `initialize' | |
from /Library/Ruby/Gems/2.0.0/gems/daybreak-0.3.0/lib/daybreak/db.rb:24:in `new' | |
from /Library/Ruby/Gems/2.0.0/gems/daybreak-0.3.0/lib/daybreak/db.rb:24:in `initialize' | |
from /Library/Ruby/Gems/2.0.0/gems/ayadn-1.8.2/lib/ayadn/databases.rb:54:in `new' |
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 | |
$html = file_get_contents('https://wiki.pnut.io/PCA'); | |
$doc = new DOMDocument(); | |
$doc->loadHTML($html); | |
$tables = $doc->getElementsByTagName('table'); | |
$pca = array(); | |
foreach ($tables as $table) { | |
if ($table->hasAttribute('class') && $table->getAttribute('class') == 'wikitable') { |
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
import pnutpy | |
response, meta = pnutpy.api.subscribed_channels(include_raw=True) | |
print("Response\n") | |
for channel in response: | |
raw = channel.get('raw') | |
if raw is not None and len(raw) > 0: | |
print(raw[0].get('value').get('name')) |
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
import xml.etree.cElementTree as ElementTree | |
import json, pytz, zipfile, unicodedata, re | |
from datetime import datetime | |
from os import listdir | |
from os.path import isfile, join | |
import glob | |
def slugify(value): | |
""" | |
Normalizes string, converts to lowercase, removes non-alpha characters. |
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
import os | |
import subprocess | |
import glob | |
import sys | |
import json | |
import re | |
import requests | |
from bs4 import BeautifulSoup | |
from colorama import Fore | |
from colorama import Style |
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
#!/bin/bash | |
# Updates rss-bridge to the latest Github release | |
# Prerequsitions: The dependencies for rss-bridge need to be installed | |
# This script uses jq, but falls bacl to using grep if jq cannot be found | |
RSS_BRIDGE_FOLDER="/var/www/html/rss-bridge/" # Edit this to point to the folder you want rss-bridge installed to | |
REPO="RSS-Bridge/rss-bridge" | |
GH_API_URL="https://api.github.com/repos/${REPO}/releases/latest" | |
VERSION_FILE="${RSS_BRIDGE_FOLDER}version.txt" | |
CACHE_FOLDER="${RSS_BRIDGE_FOLDER}cache" |