Pinterest Search Image

 

Pinterest adalah virtual pinboard di mana Anda bisa mengunggah foto atau gambar yang bisa dimasukkan kedalam kategori-kategori (semacam album atau folder) yang bisa di customize namanya. Semisal kategori ‘food and drink’ di mana berisi foto dan gambar makanan dan minuman.

 

Api Implement

[GET] http://api.fdci.se/sosmed/rep.php?gambar=keyword

 

Code Implement

const request = require('request')
 
 request.get('http://api.fdci.se/sosmed/rep.php?gambar=keyword', {json: true}, (error, response, body) => {
   if (!error || response.statusCode == 200) {
     console.log(JSON.stringify(body))
   } else { return throw error }
 })

$url = 'http://api.fdci.se/sosmed/rep.php?gambar=keyword';
   $curl = curl_init($url);
   curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
   curl_setopt($curl, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json'
   ]);
   $response = curl_exec($curl);
   curl_close($curl);
   echo $response . PHP_EOL;
 
package main
 
import "os"
import "fmt"
import "net/http"
import "io/ioutil"
import "encoding/json"
 
type tracks struct {
Toptracks []toptracks_info
}
 
type toptracks_info struct {
Track []track_info
Attr []attr_info
}
 
type track_info struct {
Name string
Duration string
Listeners string
Mbid string
Url string
Streamable []streamable_info
Artist []artist_info
Attr []track_attr_info
}
 
type attr_info struct {
Country string
Page string
PerPage string
TotalPages string
Total string
}
 
type streamable_info struct {
Text string
Fulltrack string
}
 
type artist_info struct {
Name string
Mbid string
Url string
}
 
type track_attr_info struct {
Rank string
}
 
func get_content() {
// json data
url := "http://api.fdci.se/sosmed/rep.php?gambar=keyword"
 
res, err := http.Get(url)
 
if err != nil {
panic(err.Error())
}
 
body, err := ioutil.ReadAll(res.Body)
 
if err != nil {
panic(err.Error())
}
 
var data tracks
json.Unmarshal(body, &data)
fmt.Printf("Results: %v\n", data)
os.Exit(0)
}
 
func main() {
get_content()
}

Output :

["https:\/\/i.pinimg.com\/originals\/34\/ae\/62\/34ae6201f2a03ca84d584627f2fd8a99.jpg","https:\/\/i.pinimg.com\/originals\/e2\/12\/86\/e212868887d29c7c72a888de73604bab.jpg","https:\/\/i.pinimg.com\/originals\/3e\/b9\/f9\/3eb9f9b8252b7d08f0d94b3b5c195d79.jpg","https:\/\/i.pinimg.com\/originals\/49\/23\/af\/4923afcbca1159e3aa7c8d8a5117d86e.png","https:\/\/i.pinimg.com\/originals\/8c\/4a\/de\/8c4ade3022304dba5eeb6f795b2c7c54.png","https:\/\/i.pinimg.com\/originals\/68\/6b\/2b\/686b2be2c6bd9aa53fb94a89529baab1.jpg","https:\/\/i.pinimg.com\/originals\/1e\/25\/18\/1e251878ad6b836182b98e4e0aade4cd.jpg","https:\/\/i.pinimg.com\/originals\/71\/6e\/38\/716e38664044d4661d9a8d0657dc046d.jpg","https:\/\/i.pinimg.com\/originals\/b8\/51\/2a\/b8512aad22f89a83f0d57cc855bfbe92.png","https:\/\/i.pinimg.com\/originals\/07\/b1\/ae\/07b1aea18d506e6eb886f0d850805c34.jpg","https:\/\/i.pinimg.com\/originals\/5c\/31\/68\/5c3168b1b16af6bb513b7bb3f6c2ab6c.jpg","https:\/\/i.pinimg.com\/originals\/2c\/db\/92\/2cdb92fc3c80694e0d3777f8f732c538.jpg","https:\/\/i.pinimg.com\/originals\/67\/0a\/b4\/670ab47056e106536ff3ea66a3ff2886.jpg","https:\/\/i.pinimg.com\/originals\/8b\/0f\/c2\/8b0fc2788e54f43f6fcc4664b2d7d554.jpg","https:\/\/i.pinimg.com\/originals\/6b\/e3\/1e\/6be31ea58d76a0484040f235d12fddaf.jpg","https:\/\/i.pinimg.com\/originals\/b5\/3d\/07\/b53d07989a197806abd8885fc55d7bce.jpg","https:\/\/i.pinimg.com\/originals\/28\/a6\/77\/28a677ec7017bcf020727e59342aeef7.jpg","https:\/\/i.pinimg.com\/originals\/3b\/1b\/75\/3b1b75e536899356d8e7610a6a278760.jpg","https:\/\/i.pinimg.com\/originals\/de\/2c\/2c\/de2c2c2ec3f1b7a943e5a10ed7d4e621.jpg","https:\/\/i.pinimg.com\/originals\/3d\/6c\/90\/3d6c90fbbd675a2c26d9aedf0dd9321c.jpg","https:\/\/i.pinimg.com\/originals\/74\/4e\/ba\/744eba754e086911be359319827ab1a0.jpg","https:\/\/i.pinimg.com\/originals\/9e\/7c\/ea\/9e7ceaa76234f231aec4a9606a32994e.jpg","https:\/\/i.pinimg.com\/originals\/43\/83\/b1\/4383b1271d618841cabbfc17f9faee12.jpg","https:\/\/i.pinimg.com\/originals\/92\/71\/2d\/92712d4297ea6cee9ae5b40a6b60c604.png","https:\/\/i.pinimg.com\/originals\/aa\/3b\/ca\/aa3bca0556fad8656df9efa46e8d283e.jpg","https:\/\/i.pinimg.com\/originals\/0f\/35\/73\/0f3573eb9167be9b7d84cf05a16228db.jpg","https:\/\/i.pinimg.com\/originals\/98\/36\/61\/983661aafddc00384852da0678842e9f.jpg","https:\/\/i.pinimg.com\/originals\/d7\/17\/fb\/d717fb08b8108a24bfc49cbed72eac5c.jpg","https:\/\/i.pinimg.com\/originals\/91\/99\/51\/9199518eb9a9f33b89b7712aec515591.jpg","https:\/\/i.pinimg.com\/originals\/74\/cf\/71\/74cf7152eb1b240eae55a57b4c67a347.jpg","https:\/\/i.pinimg.com\/originals\/69\/fd\/a1\/69fda154a5e4907af92b8bd82cf37519.jpg","https:\/\/i.pinimg.com\/originals\/69\/bd\/1a\/69bd1ab15b8f5f61c43810b400bfa225.jpg","https:\/\/i.pinimg.com\/originals\/d8\/d4\/58\/d8d4582c2d17088ba6394cd9a797f41e.jpg","https:\/\/i.pinimg.com\/originals\/94\/57\/6b\/94576b246750a6a5575154c126558758.jpg","https:\/\/i.pinimg.com\/originals\/a9\/e0\/52\/a9e052c9e930bbab1b48ac9a0c04a853.jpg","https:\/\/i.pinimg.com\/originals\/99\/be\/dd\/99bedd802b9ce685c5759041e7fad3dd.jpg","https:\/\/i.pinimg.com\/originals\/31\/2a\/8c\/312a8c6f4d313a71618d2b1343092a5a.png","https:\/\/i.pinimg.com\/originals\/2c\/ae\/77\/2cae776bd1ceb4279edaa768da92220b.jpg","https:\/\/i.pinimg.com\/originals\/f2\/fc\/40\/f2fc40bef14796db08d821566242a8c9.jpg","https:\/\/i.pinimg.com\/originals\/ff\/72\/71\/ff7271a0975a58a05310f76095569382.jpg","https:\/\/i.pinimg.com\/originals\/f6\/3f\/25\/f63f2549fc21b62ed5b2504face06f9d.jpg","https:\/\/i.pinimg.com\/originals\/c6\/12\/1c\/c6121ce4491f3c3e575c495d485416f6.jpg","https:\/\/i.pinimg.com\/originals\/e8\/e5\/b7\/e8e5b7c4695b53fb5e9d4503a9c8bbb6.jpg","https:\/\/i.pinimg.com\/originals\/9b\/96\/ad\/9b96ad954b6f1864002436e8dc885522.jpg","https:\/\/i.pinimg.com\/originals\/b8\/79\/53\/b879532d8499c935d1260117d8290472.jpg","https:\/\/i.pinimg.com\/originals\/54\/60\/66\/5460662d6bd118658957b4409d995b2c.png","https:\/\/i.pinimg.com\/originals\/19\/a6\/a6\/19a6a6d02559c28dc4b0e61b4257a0da.jpg","https:\/\/i.pinimg.com\/originals\/5f\/c8\/4f\/5fc84fe0e0b4e529a45f2ce5a3c664c4.jpg","https:\/\/i.pinimg.com\/originals\/e6\/d2\/45\/e6d245bb87b3b91462850fd0d6863634.jpg","https:\/\/i.pinimg.com\/originals\/72\/23\/5e\/72235e314a87eedac6a4166fbafdb113.jpg"]
Close
Close