This script helps you to download locally the latest pictures related to a specific Instagram hashtag. It will fetch them and sort them by username.
No resume feature. No extra metadata. No OAuth pain.
| #!/bin/bash | |
| casperjs tn_news.js | |
| ./rss_news.rb http://www.clarin.com/rss/lo-ultimo/ Clarin | |
| ./rss_news.rb http://contenidos.lanacion.com.ar/herramientas/rss-origen=2 LaNacion |
| // Set startFrame and endFrame for _contentView | |
| CGRect endFrame = _contentView.frame; | |
| CGRect startFrame = endFrame; | |
| startFrame.origin.y = -startFrame.size.height; | |
| _contentView.frame = startFrame; | |
| void (^animationBlock)(void) = ^(void){ | |
| _contentView.frame = endFrame; | |
| }; |
| // Error reported in http://stackoverflow.com/questions/23819466/error-return-address-clgeocoder | |
| NSString *anAddressString = @"568 Broadway, New York, NY" | |
| CLGeocoder *geocoder = [[CLGeocoder alloc] init]; | |
| void (^geocodeBlock)(NSArray *placemarks, NSError *error) = ^(NSArray *placemarks, NSError *error) { | |
| if (error) { | |
| /* | |
| * Printing error gets -> Error Domain=kCLErrorDomain Code=2 "The operation couldn’t be |
| import sys, math, random | |
| class Point: | |
| def __init__(self, coords, reference=None): | |
| self.coords = coords | |
| self.n = len(coords) | |
| self.reference = reference | |
| def __repr__(self): | |
| return str(self.coords) |
| // Needs CoreImage.framework | |
| - (UIImage *)blurredImageWithImage:(UIImage *)sourceImage{ | |
| // Create our blurred image | |
| CIContext *context = [CIContext contextWithOptions:nil]; | |
| CIImage *inputImage = [CIImage imageWithCGImage:sourceImage.CGImage]; | |
| // Setting up Gaussian Blur | |
| CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"]; |
| CGImageRef CGImageFromFile (NSString* path){ | |
| // Get the URL for the pathname passed to the function. | |
| NSURL *url = [NSURL fileURLWithPath:path]; | |
| CGImageRef myImage = NULL; | |
| CGImageSourceRef myImageSource; | |
| CFDictionaryRef myOptions = NULL; | |
| CFStringRef myKeys[2]; | |
| CFTypeRef myValues[2]; | |
| // Set up options if you want them. The options here are for |
| // Image processing: creating CIImage | |
| NSString *filename = [module.imageFilename stringByDeletingPathExtension]; | |
| NSString *fileExtension = [module.imageFilename pathExtension]; | |
| NSString *filePath = [[NSBundle mainBundle] pathForResource:filename ofType:fileExtension]; | |
| NSURL *fileURL = [NSURL fileURLWithPath:filePath]; | |
| CIImage *coreImage = [CIImage imageWithContentsOfURL:fileURL]; | |
| CIContext *context = [CIContext contextWithOptions:nil]; | |
| // Image processing: applying filter |
| #GET | |
| curl -HAccept:text/plain http://example.com/base | |
| #PUT | |
| curl -XPUT -HContent-type:text/plain --data "stuff:morestuff" http://example.com/base?param=val | |
| #DELETE | |
| curl -XDELETE http://example.com/base/user/123 | |
| #POST |
| -(NSString *) currentSong { | |
| NSString *retVal = nil; | |
| MPMusicPlayerController* iPodMusicPlayer = [MPMusicPlayerController iPodMusicPlayer]; | |
| MPMediaItem *mediaItem = [iPodMusicPlayer nowPlayingItem]; | |
| if (mediaItem) { | |
| NSString *artist = [mediaItem valueForProperty: MPMediaItemPropertyArtist]; | |
| NSString *song = [mediaItem valueForProperty: MPMediaItemPropertyTitle]; | |
| retVal = [NSString stringWithFormat:@"NLT: %@ - %@", song, artist]; |