Avoiding PHP timeout when geocoding many addresses – preferred method?
I have a script that’s taking in a ton of address data from a CSV, converting it to JSON, and along the way it hits the Google Maps API to get the latitude and longitude of each address. It then writes...
View ArticleWhat's the best way to return an array as a response in a RESTful API?
Assume we have resources like this, book: type: object properties: author: {type: string} isbn: {type: string} title: {type: string} books: type: array items: book So, when someone makes a GET on the...
View Articlesql org chart hierarchical table to xml json
I have a table of employees and managers: create table emp_mgr (emp varchar(99), mgr varchar(99)) insert into emp_mgr select 'Adam',NULL; insert into emp_mgr select 'Bob','Adam'; insert into emp_mgr...
View ArticleFull-Ajax Theme: parseJSON error while building a JSON object from a...
Trying to make a full-ajax navigation on my new portfolio, I read online on a few different blog that building the templates using JSON would be easier in order to treat the datas however I want. It is...
View ArticleImport facebook feed as a post in wordpress with 100,000 of posts
I need to import facebook feed of one of my facebook pages as posts to wordpress site using facebook graphic API. For this purpose I am fetching the json file with all the posts from facebook in it and...
View ArticleWhy does `cat` seem to iterate over JSON arrays?
I’m puzzled by this behaviour of cat when trying to output a heredoc containing JSON in bash 3.2: input: $ cat <(cat <<EOF > {"x":[{"a":1,"b":2}]} > EOF) output: {"x":["a":1]}...
View ArticleREST export doesn't give image URLs
We have a headless Drupal 7 project that uses express and handlebars for it’s front end. I’m experimenting with updating the backend to use Drupal 8. I’ve created a REST export type view, but when you...
View ArticleRetrieve list of taxonomies in json
I have custom taxonomies like that /wp-admin/edit-tags.php?taxonomy=my_cat&post_type=my_poet I want retrieve list of taxonomies in json add_action('init', array($this, 'json_handler')); I tried...
View ArticleHow to print the output of the json?
I have this code :- function retrieve_comments(){ $myPost = $_REQUEST['post_id']; $output = get_comments('post_id='.$myPost); if(is_array($output)){ $response['output'] = $output;...
View ArticleRepresenting a “Belongs to” relationship in an API endpoint
Consider the following pseudo code models: class Post int Id string Title int CategoryId Category Category class Category int Id string Name Note that Post belongs to Category. This is achieved via a...
View ArticleREST Call to get DefaultNewFormUrl
I am trying to make a call to the REST service in Javascript to collect the ‘DefaultNewFormUrl’ for a specific list. The property is “not returned with the resource” so I need to make a separate call...
View ArticleHow to import JSON data from a XML element
I’m completely stuck with this problem for days now and I hope someone can help me out. I’m no expert in XPath so please forgive me if my question is a bit noobish: I want to import XML data from a...
View ArticleGenerate attachement to Post from featured image
I am using WP-JSON API Plugin. If i choose an image as featured that is allready uploaded in my media library it does not generate attachements Object in JSON like the example bellow. attachments: [ {...
View Articletoken based authentication attacks
JSON Web Token seems to be a very good tool to authenticate users. But I wonder if an attacker can take the token used by another user and use it for his own attacks. And to be more precise what makes...
View ArticleDump all posts to file via WordPress JSON API?
I would like to dump all posts to a JSON file so I can include it in my mobile app project. That way, the app can work offline for the most part, then I just have to query new and modified posts from...
View ArticleLeaflet marker cluster from JSONP WFS + Popups
I’m fairly new to Leaflet and just managed to use Leaflet marker-cluster with a JSONP WFS which provides my data from Geoserver. Now I would like to have a popup for my markers by mouse click. But I do...
View ArticleTransforming XML to JSON in C++ [closed]
Working with XML in C++ seems a bit of a pain and I’m looking at a way to output JSON. I’ve stumbled on two different approaches: A) XSLT transformations:...
View ArticleAjax specific template not loading in replacement of index.php
Following my previous post (Full-Ajax Theme: parseJSON error while building a JSON object from a WordPress custom template) regarding a few problems concerning JSON (now resolved), I am trying to load...
View ArticleSaving a piped value went wrong
I installed jq to handle some JSON with bash. But somehow piping the JSON string to jq in combination with saving it’s output to another variable went wrong. TEST='{"foo": "bar"}' PB_SIG=$TEST | jq...
View ArticleBest way to perform real time analytics on a growing collection of json file...
I have a very large collection of JSON file (tens of millions) on S3 and I need to have some kind of aggregation (perform continuously as the collection grows). The aggregation is mainly counter...
View Article