Skip to content

Instantly share code, notes, and snippets.

View aaronpearce's full-sized avatar

Aaron Pearce aaronpearce

View GitHub Profile
@aaronpearce
aaronpearce / Objective-C Message Folder Grabber
Created April 25, 2011 20:50
Obj-C Message Folder Grabber for deviantART
// inboxId is retrieved before hand.
int maxItems = 20;
NSString *queryString = [NSString stringWithFormat:@"?
c[]=MessageCenter;get_views;%@,oq:fb_comments:0:%@:f&
c[]=MessageCenter;get_views;%@,oq:fb_replies:0:%@:f&
c[]=MessageCenter;get_views;%@,oq:notes_unread:0:%@:f&
c[]=MessageCenter;get_views;%@,oq:notices:0:%@:f&
c[]=MessageCenter;get_views;%@,oq:contests:0:%@:f&
c[]=MessageCenter;get_views;%@,oq:fb_activity:0:%@:f&
c[]=MessageCenter;get_views;%@,oq:correspondence:0:%@:f&
@aaronpearce
aaronpearce / Message Center Loader
Created April 25, 2011 22:55
Loader for first message center folders!
- (void) load {
dALogin = [[dAlogin alloc] init];
[dALogin login:@"pickley":@"yaaa...nah"];
theDiFi *difi = [[theDiFi alloc] init];
if([dALogin loggedOn]) {
[difi folderRequest];
NSDictionary *test = [difi folders];
NSLog(@"%@", [[[[[[[[test valueForKey:@"DiFi"] valueForKey:@"response"] valueForKey:@"calls"] valueForKey:@"response"] valueForKey:@"content"] objectAtIndex:0] objectAtIndex:0] valueForKey:@"folderid"]);
}
}
Incident Identifier: 4F6F998A-6751-456C-AEDB-85C3DA32F5E5
CrashReporter Key: 374a4d22a0a9d673210f2fc2d012b7842bf8c441
Hardware Model: iPod4,1
Process: Chatter [2626]
Path: /var/mobile/Applications/674F6861-31F4-4C58-AC33-08C0EA44D920/Chatter.app/Chatter
Identifier: Chatter
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: crunchd [1]
@aaronpearce
aaronpearce / gist:961147
Created May 8, 2011 05:44
Loggy McLog Log.
Incident Identifier: 4F6F998A-6751-456C-AEDB-85C3DA32F5E5
CrashReporter Key: 374a4d22a0a9d673210f2fc2d012b7842bf8c441
Hardware Model: iPod4,1
Process: Chatter [2626]
Path: /var/mobile/Applications/674F6861-31F4-4C58-AC33-08C0EA44D920/Chatter.app/Chatter
Identifier: Chatter
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: crunchd [1]
@aaronpearce
aaronpearce / gist:973770
Created May 16, 2011 01:39
Regex help?
<span class="tt-w"><span class="shadow" style="background-image:url(http://sh.deviantart.net/shadow/x/150/150/logo3.png);"><a class="thumb" href="http://pasiasty.deviantart.com/art/Emilie-7548-187033952" title="Emilie 7548 by *pasiasty, Nov 22, 2010 in Photography > People & Portraits > Classic Portraits" super_img="http://th08.deviantart.net/fs71/PRE/f/2010/326/e/7/emilie_7548_by_pasiasty-d33csbk.jpg" super_fullimg="http://fc03.deviantart.net/fs71/f/2010/326/e/7/emilie_7548_by_pasiasty-d33csbk.jpg" super_fullw="900" super_fullh="900" super_w="894" super_h="894"><i></i>
WANT THE SRC OUT OF THIS? Regex?
<img class='sq' width="150" height="150" src="http://th03.deviantart.net/fs71/150/f/2010/326/e/7/emilie_7548_by_pasiasty-d33csbk.jpg"></a></span><!-- ^TTT --><!-- TTT$ --></span></div></div>
@aaronpearce
aaronpearce / kouiskas log
Created May 21, 2011 23:35
kouiskas log
11:40:31 PM <kouiskas> yes, have been for almost 2 years
11:40:41 PM <Pickley> Cool
11:40:47 PM * Pickley is disliking DiFi a lot so far.
11:41:24 PM <kouiskas> DiFi was never meant for 3rd party use that's why there's no documentation for it
11:41:36 PM <Pickley> Oh we have docs.
11:41:43 PM <Pickley> Just with tiny gaps
11:42:07 PM <Pickley> kouiskas: Is it possible to add into the get_folders call a thing that signifies if a folder is a group or not
11:42:40 PM <Pickley> kouiskas: Until a full API is out, including reading of resources and messages with responses we still have to use DiFi
11:42:47 PM <kouiskas> to DiFi? sorry we're not taking requests for DiFi
11:42:50 PM <kouiskas> the API is separate
-(NSString *)avatarCreate:(NSString *)username:(NSInteger)num {
NSArray *extensions = [NSArray arrayWithObjects:@".gif", @".gif", @".jpg", @".png", nil];
NSLog(@"%@", num);
num &= 3;
NSLog(@"%@", num);
NSString *extension = [extensions objectAtIndex:num];
if([extension isEqualToString:@""]) {
extension = @".gif";
}
NSString *userurl;
@aaronpearce
aaronpearce / gist:1005766
Created June 3, 2011 02:38
Auth grab Obj-C
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"https://www.deviantart.com/api/draft15/user/damntoken"]];
[request addRequestHeader:@"Authorization" value:[NSString stringWithFormat:@"OAuth %@", [auth accessToken]]];
NSLog(@"%@", auth );
[request startSynchronous];
NSError *error = [request error];
if (!error) {
NSString *response = [request responseString];
NSLog(@"%@", response);
} else {
Hey,
Thanks for taking the time to discuss this with me.
The developers of the community are interested in running a featured chat with some of dA's developers to ask questions about the API, dA technologies and more general stuff.
Having a featured chat with the developers behind dA would help the third party developers based around dA to make some more awesome extensions and scripts while also allowing us to discuss some of the issues we see with small stuff on dA.
The other issue is how we see chats running in #auditorium go. The issue is that anyone can ask which normally results in the good questions not being asked, we'd prefer a way to get our questions to the developers first then let others ask if possible?
@aaronpearce
aaronpearce / gist:1009619
Created June 6, 2011 01:28
oAuth2 deviantART Commandline idea
First you give the user the auth url (could open it automatically using open, start or browser) eg:
Client_id = your client id.
https://www.deviantart.com/oauth2/draft15/authorize?client_id=**&redirect_uri=http://aaronpearce.com&response_type=code
This will ask to auth (they will need to be logged in to the correct account) then it will redirect to that site.
That code is used to grab your access token. A specialized site will be put up to allow users to read this easier. (dA might put one up, I asked)
Then you will curl to the token is this: