API stands for Application Programming Interface. A program's API defines the proper way for a developer to request services from that program.
-1
votes
0answers
19 views
Instagram API pagination with JavaScript [closed]
I'm new to front-end dev, I've started learning three months ago. I'm working on an API from Instagram but the pagination part is not working. I have tried so many types of codes, but nothing.
If you ...
3
votes
2answers
51 views
Structure of API wrapper
I'm building an API wrapper for a bookkeeping SOAP API.
I have some questions regarding bast practice for structure of the wrapper and for error handling.
For now i've structured it like this:
...
-2
votes
0answers
14 views
Retrieving User Information from Google Plus API with PHP [closed]
When you're visiting this page:
https://www.googleapis.com/plus/v1/activities/z12gtjhq3qn2xxl2o224exwiqruvtda0i?key=AIzaSyAwnz3yjIcvsosfbudkzl9oogGrT21m6Ns
...i guess what is called an object, ...
0
votes
1answer
74 views
In-memory data cache architecture for data transfer
I am writing a cron job to manipulate and transfer remote data.
I need to cache data from a table, process it, merge with previous table, iterate the process, and eventually send the result data to ...
1
vote
1answer
35 views
Rails 4.0 api_key implementation
I'll be brief and let the code speak for itself. I need some very harsh, honest, blunt feedback on this code. I am new to Rails - don't hold back.
I have a concept of the user having many API keys, ...
3
votes
2answers
57 views
Multiple serial URL requests in Objective-C / iOS
I want to check the existence of various API endpoints by doing serial URL request. If the first one fails, I want to try the second one, if the second fails I want to try the third one, etc.
Here is ...
2
votes
1answer
59 views
RESTfulPHP / controller / structure
Allow for stuff like:
API/ExampleObjects
API/ExampleObjects/SOME_INTEGER_ID/Children
...
with children knowing their owners (aka parents).
Full repo here
Please be brutally honest if something ...
1
vote
1answer
35 views
Node.js DynamoDB callback
I am writing an API which gets results from a DynamoDB table and puts the JSON back into the browser.
The code below works and returns the desired results. However, after reading about async and ...
2
votes
1answer
64 views
Python Leafly API
Just wondering what I did bad/could have done better. It's a simple script for pulling information from Leafly about cannabis strains. I've also added in a function to search. I am fairly new to ...
1
vote
1answer
115 views
Python API client design and best practices
I'm creating a Python API client, after thinking and checking some open source Python clients I created this class, and I'm looking for any feedback (design, best practices...), this is an example URL ...
6
votes
2answers
190 views
WebAPI - Return models vs entity and partial class with meta data
Wanted some opinions on something I have been working with, I've tried a few ways of structuring the way I retrieve and return data to my WebAPI, and I'm pretty happy with what I have so far, but I ...
2
votes
0answers
68 views
node.js Review Core class of a Javascript framework for SPA's
A few years ago I started building a tiny (~300 SLOC) JavaScript framework for scalable and maintainable Single-Page-Applications written in CoffeeScript:
https://github.com/flosse/scaleApp and ...
1
vote
0answers
47 views
Ruby API wrapper extract authentication(get session key) [closed]
module MyApp
class Auth
include HTTParty
base_uri 'https://api.myapp.de/'
def initialize(login, password)
@login = login
@password = password
end
def session
...
1
vote
1answer
141 views
Code review on an API wrapper in C# wanted
I'm looking for remarks on pretty much anything. This has been my first project that's meant for use by others and I'd like to have it as clean as possible. I will post the main source code here but ...
0
votes
2answers
49 views
the right way to write javascript client's method for channel subscribing
I am writing an open-source application for real-time messaging in web. In my application clients from browser can subscribe on channels. But every channel belongs to a certain namespace which ...
1
vote
1answer
226 views
C# Fluent API idea
I've been toying with an idea for fluent API for my library. Basically, what you need to construct with my library is a tree, which might have nodes of different types on different levels. The problem ...
1
vote
0answers
19 views
Providing a Protected Global API to Third-Party Widgets
I am creating a Web Application which provides a global Javascript-based API (in the variable System) and it includes methods that will be provided by frameworks (stored in System.Frameworks[name]).
...
0
votes
0answers
49 views
How can I refactor Api::SessionsController?
I have session controller for mobile devices. I would like to refactor it a little, for example because my session controller is sub class of Devise::SessionsController I had to duplicate error ...
0
votes
1answer
72 views
How should I refactor my image uploader script?
I come from a C background and need help refactoring the following imgur image uploader script I wrote.
It checks if a token_file with access_token and refresh_token exists. If not, it instructs the ...
0
votes
0answers
167 views
Twitter API PHP script is EXTREMELY SLOW … What could be causing this ? the page takes a long time to display results
So I have this PHP script below that requests data from the Twitter API and then displays it on the page according to the information that I have in my local database because I stored twitter ...
3
votes
2answers
122 views
Singly-linked List Library
This is sort of a follow-up to a post I created about 10 days ago, but I have completed the implementation: Designing function prototypes for a singly-linked list API in C.
As I began to work on the ...
2
votes
1answer
93 views
Designing function prototypes for a singly-linked list API in C
I am in the process of rewriting in C all the data structures that I learned about a few years ago to increase my understanding of data structures and the C language. The first one I'm doing is ...
0
votes
2answers
126 views
How is this for an API structure
I have just written an API framework which I am hoping to implement into one of my large sites very soon. However, before I do so, I want to be sure that the script is well written and there are no ...
2
votes
1answer
85 views
Refactor code for API wrapper
I am looking for ways to improve my API wrapper for Pocket. So far, my code is quite compact and nice (I think), but I feel like there must be a better way to do this.
This is the part where I think ...
1
vote
1answer
58 views
Designing a RESTful API for a 3D Printer
I'm implementing a REST API to manage a 3D printer, it will add a layer to the system so instead of sending GCode commands (the language the controller understands) directly to the controller (an ...
1
vote
0answers
51 views
Go: stream chaining
My goal is to have a reusable pattern for doing concurrent stream processing in Go.
The stream has to be closable from any node.
Errors should cleanly close the stream and forward the error to the ...
1
vote
1answer
467 views
REST-ish API Account Controller - how's it look?
I still have to implement api keys for client auth, but so far this is what I have for users. This was built using WebAPI and SimpleMembership with Forms Auth:
Is Authenticated:
public class ...
1
vote
0answers
56 views
General Code Review - Key Press Handler
I have made a class to import into my projects to more easily handle the state of the keyboard so I can use stuff like:
if(Keys.returnKey(37)){
As opposed to setting up key listeners.
Could you ...
2
votes
2answers
144 views
Is it ok to use PHP's strpos and substr altogether in one statement?
I am using PHP to build a REST API. I want to receive requests from the URL in the following format:
http://mydomain.com/api/format/method?app_id=value&call=encrypted_request
So, I have modified ...
3
votes
1answer
231 views
how can i make this small jQuery serializeobject util any better
I have this little utility/helper which serializes a form into a javaScript object
$.fn.serializeObject = function(fn) {
var o = {},
a = ...
6
votes
1answer
256 views
Doubts about the quality of an API designed for use with minimal effort
This is going to be long, and I do hope it is going to make some kind of sense; I apologize if it doesn't. I'll try to provide exactly the amount of context that is necessary to understand the ...
2
votes
0answers
92 views
jQuery plugin boilerplate jquib - critics please
Inspired by jqueryboilerplate.com I extended their boilerplate to fit my needs. Comming from the PHP development I wanted to have good starting point for writing jQuery plugins with a defined ...
4
votes
1answer
984 views
Backbone.js Dependency Injection API Design
I'm writing a dependency injection plugin for the Backbone javascript framework, and I'm not sure what the API for constructor argument injection should look like.
Just for reference, Backbone ...
1
vote
2answers
172 views
How can this code become cleaner and less error prone? Especially the binary search part
How could this code become cleaner?
I think that the way I handle the interfaces and binary search could be improved.
I am trying to understand how to structure such a code 9and usage of APIs) in a ...
1
vote
0answers
798 views
User management in Node.JS
I have moved all my webserver code dealing with user management into a single Node.JS module that I paste below. I have spent time polishing it, and churned it through JSHint. I am generally happy ...
0
votes
1answer
96 views
(revised) Python script to access genealogy api for list of users and attributes
The problem the code is solving
This is a script to access the stackexchange api
for the genealogy site
and create a list of user dictionaries.
Ie each user dictionary contains the info about that ...
0
votes
1answer
118 views
Accessing a REST API with PHP
I'm currently using a scientific information management system that employs a RESTful API. I've never used this API with PHP, and I had a hard time finding best practice examples online. After some ...
1
vote
1answer
175 views
Is there a better way to loop through records and call an api?
I have a CakePHP function here that gets info for a twitter screen_name from the twitter api and writes it to a mysql db. I'm just looking for feedback about other ways to accomplish this that might ...
2
votes
1answer
172 views
Creating JavaScript API for first time; request review
I am creating a commercial API for the first time for responsive webpages/web applications (mobile devices).
I am new and, sadly, working alone as well as new to Javascript (long complicated story).
...
1
vote
2answers
309 views
PHP api design - anything done badly?
I have created an api in php and I was hoping some clever individuals would mind reviewing it to see what I could do better. I have commented it heavily to explain my reasoning. please feel free to ...
0
votes
0answers
72 views
Javascript API - Library Loader
What my API does and Why - A Brief Explanation
I have written a Javascript API that loads and houses libraries of code to do all sorts of things on websites.
Effectively, this is (will be) the base ...
1
vote
0answers
131 views
MixpanelAPI - my first open source project
I would love to hear feedback on my first open source project (a very simple async API for Mixpanel)
It implements a REST client for this REST HTTP API
Review requested on the following aspects:
...
2
votes
3answers
245 views
ACM API based Java exercise
I came across an exercise (in the book "The Art and Science of Java" by Eric Roberts) that requires using only GArc and GLine classes to create a lettering library which draws your initials on the ...
4
votes
1answer
229 views
Loading Javascript Libraries with PHP API
First question on this site so please take it easy on me and let me know if I infringe the common etiquette :-)
I have written the following script which simply:
Loops through javascript files ...
2
votes
2answers
476 views
Review My Custom Streaming Application - AJAX / TwitchTV
So I created this custom application and ported it into a few websites. It uses the TwitchTV API and pulls in active streams and the viewer count. The problem I run into is when the list gets so big ...
4
votes
2answers
3k views
RSpec integration tests for a simple Rails API
The Model is simple. A Player class with three attributes: first_name, last_name, and team_id.
I'm just trying to get a handle on TDD for what will expand into a much more robust API. Below is my ...
3
votes
1answer
84 views
Feedback on my Perl wrapper library (written using Moose) for a REST API
I wrote a wrapper library for a REST API (https://semantics3.com) in perl using the Moose library. I would like to gather some feedback on it (mainly on the oop part since I am new to moose), before ...
3
votes
1answer
226 views
Protecting certain model attributes from being exposed in an API
There can be a business or security requirement that certain fields on a model should never be exposed in an API. One approach to this is to tell the developers not to ever put the field in the API ...
5
votes
1answer
122 views
How can I optimize this linspace method build in Python's C API?
Today I built a linspace function in Python's C API, here is its code:
static PyObject *
linspace(PyObject * self, PyObject * args)
{
int n, i;
double start, end;
if ...
3
votes
1answer
1k views
Unit Testing Code that Calls RESTful API
So I'm writing a library which calls a RESTful API and then performs some work on the data. I've architected my code like this:
I have a class, let's call it APIRequestor that initiates a call to the ...