I am totally new in xamarin forms. I am trying to make an app that uses the TMDB api to display a list with movies but i am getting this exception:
Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[CinemaApp.Models.NowPlaying]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
This is my xaml file
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="CinemaApp.PlayingNowPage">
<ContentPage.Content>
<AbsoluteLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<StackLayout x:Name="SLMovies" AbsoluteLayout.LayoutFlags="All"
AbsoluteLayout.LayoutBounds="0,0,1,1">
<ListView x:Name="MoviesListView"
HasUnevenRows="True"
SeparatorVisibility="None">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Frame>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.4*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding full_poster_path}" Grid.Column="0"
HeightRequest="120"
WidthRequest="150"/>
<StackLayout Grid.Column="1">
<Label Text="{Binding title}"
TextColor="#E91E63"
FontAttributes="Bold"/>
<Label Text="{Binding vote_average}"/>
<Label Text="{Binding release_date}">
</Label>
<StackLayout
Orientation="Horizontal"
HorizontalOptions="FillAndExpand">
<Label HorizontalOptions="EndAndExpand"
Text="{Binding Duration}">
</Label>
</StackLayout>
</StackLayout>
</Grid>
</Frame>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
<StackLayout
x:Name="SLLoader"
IsVisible="True"
Padding="12"
AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="0.5,0.5,-1,-1">
<ActivityIndicator
IsRunning="True"
Color="#00000000"/>
<Label
Text="Loading..."
HorizontalOptions="Center"
TextColor="Red"/>
</StackLayout>
</AbsoluteLayout>
</ContentPage.Content>
</ContentPage>
This is the class for the objects
using System;
using System.Collections.Generic;
using System.Text;
namespace CinemaApp.Models
{
public class NowPlaying
{
public int id { get; set; }
public bool video { get; set; }
public double vote_average { get; set; }
public string title { get; set; }
public string poster_path { get; set; }
public string original_title { get; set; }
public string release_date { get; set; }
public string full_poster_path
{
get
{
if (string.IsNullOrEmpty(poster_path))
{
return string.Empty;
}
return string.Format("https://image.tmdb.org/t/p/w185/" +
poster_path);
}
}
}
}
And this the main class:
namespace CinemaApp
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class PlayingNowPage : ContentPage
{
public PlayingNowPage ()
{
InitializeComponent ();
GetMovies();
}
private async void GetMovies()
{
try
{
SLLoader.IsVisible = true;
HttpClient client = new HttpClient();
var response = await client.GetStringAsync(
"https://api.themoviedb.org/3/movie/now_playing?
api_key=XXXX&language=en-US&page=1");
var movies = JsonConvert.DeserializeObject<List<NowPlaying>>
(response);
Console.WriteLine("rere "+movies);
MoviesListView.ItemsSource = movies;
}
catch (Exception e)
{
Console.WriteLine("Error: " + e);
}
finally
{
SLLoader.IsVisible = false;
}
}
}
}
Your NowPlaying model only has the data for the object in one now playing result. If you look at the response, like in an example on the website: https://developers.themoviedb.org/3/movies/get-now-playing
{
"page": 1,
"results": [
{
"poster_path": "/e1mjopzAS2KNsvpbpahQ1a6SkSn.jpg",
"adult": false,
"overview": "From DC Comics comes the Suicide Squad, an antihero team of incarcerated supervillains who act as deniable assets for the United States government, undertaking high-risk black ops missions in exchange for commuted prison sentences.",
"release_date": "2016-08-03",
"genre_ids": [
14,
28,
80
],
"id": 297761,
"original_title": "Suicide Squad",
"original_language": "en",
"title": "Suicide Squad",
"backdrop_path": "/ndlQ2Cuc3cjTL7lTynw6I4boP4S.jpg",
"popularity": 48.261451,
"vote_count": 1466,
"video": false,
"vote_average": 5.91
},
{
"poster_path": "/lFSSLTlFozwpaGlO31OoUeirBgQ.jpg",
"adult": false,
"overview": "The most dangerous former operative of the CIA is drawn out of hiding to uncover hidden truths about his past.",
"release_date": "2016-07-27",
"genre_ids": [
28,
53
],
"id": 324668,
"original_title": "Jason Bourne",
"original_language": "en",
"title": "Jason Bourne",
"backdrop_path": "/AoT2YrJUJlg5vKE3iMOLvHlTd3m.jpg",
"popularity": 30.690177,
"vote_count": 649,
"video": false,
"vote_average": 5.25
},
{
"poster_path": "/tgfRDJs5PFW20Aoh1orEzuxW8cN.jpg",
"adult": false,
"overview": "Arthur Bishop thought he had put his murderous past behind him when his most formidable foe kidnaps the love of his life. Now he is forced to travel the globe to complete three impossible assassinations, and do what he does best, make them look like accidents.",
"release_date": "2016-08-25",
"genre_ids": [
80,
28,
53
],
"id": 278924,
"original_title": "Mechanic: Resurrection",
"original_language": "en",
"title": "Mechanic: Resurrection",
"backdrop_path": "/3oRHlbxMLBXHfMqUsx1emwqiuQ3.jpg",
"popularity": 20.375179,
"vote_count": 119,
"video": false,
"vote_average": 4.59
},
{
"poster_path": "/3ioyAtm0wXDyPy330Y7mJAJEHpU.jpg",
"adult": false,
"overview": "A high school senior finds herself immersed in an online game of truth or dare, where her every move starts to be manipulated by an anonymous community of \"watchers.\"",
"release_date": "2016-07-27",
"genre_ids": [
18,
53
],
"id": 328387,
"original_title": "Nerve",
"original_language": "en",
"title": "Nerve",
"backdrop_path": "/a0wohltYr7Tzkgg2X6QKBe3txj1.jpg",
"popularity": 7.17729,
"vote_count": 86,
"video": false,
"vote_average": 6.84
},
{
"poster_path": "/3S7V2Jd2G61LltoCsYUj4GwON5p.jpg",
"adult": false,
"overview": "A woman with a seemingly perfect life - a great marriage, overachieving kids, beautiful home, stunning looks and still holding down a career. However she's over-worked, over committed and exhausted to the point that she's about to snap. Fed up, she joins forces with two other over-stressed moms and all go on a quest to liberate themselves from conventional responsibilities, going on a wild un-mom like binge of freedom, fun and self-indulgence - putting them on a collision course with PTA Queen Bee Gwendolyn and her clique of devoted perfect moms.",
"release_date": "2016-07-28",
"genre_ids": [
35
],
"id": 376659,
"original_title": "Bad Moms",
"original_language": "en",
"title": "Bad Moms",
"backdrop_path": "/l9aqTBdafSo0n7u0Azuqo01YVIC.jpg",
"popularity": 6.450367,
"vote_count": 107,
"video": false,
"vote_average": 5.49
},
{
"poster_path": "/sRxazAAodkAWVPJighRAsls2zCo.jpg",
"adult": false,
"overview": "A falsely accused nobleman survives years of slavery to take vengeance on his best friend who betrayed him.",
"release_date": "2016-08-17",
"genre_ids": [
12,
36,
18
],
"id": 271969,
"original_title": "Ben-Hur",
"original_language": "en",
"title": "Ben-Hur",
"backdrop_path": "/A4xbEpe9LevQCdvaNC0z6r8AfYk.jpg",
"popularity": 6.379067,
"vote_count": 60,
"video": false,
"vote_average": 3.83
},
{
"poster_path": "/aRRLpsusORQxOpFkZvXdk00TkoY.jpg",
"adult": false,
"overview": "Nate Foster, a young, idealistic FBI agent, goes undercover to take down a radical white supremacy terrorist group. The bright up-and-coming analyst must confront the challenge of sticking to a new identity while maintaining his real principles as he navigates the dangerous underworld of white supremacy. Inspired by real events.",
"release_date": "2016-08-19",
"genre_ids": [
80,
18,
53
],
"id": 374617,
"original_title": "Imperium",
"original_language": "en",
"title": "Imperium",
"backdrop_path": "/9dMvJJ0eTVetq3kLwUXcphsY5H.jpg",
"popularity": 5.855316,
"vote_count": 33,
"video": false,
"vote_average": 6.05
},
{
"poster_path": "/4pUIQO6OqbzxrFLGMDf2dlplSR9.jpg",
"adult": false,
"overview": "Southside With You chronicles a single day in the summer of 1989 when the future president of the United States, Barack Obama, wooed his future First Lady on an epic first date across Chicago's South Side.",
"release_date": "2016-08-26",
"genre_ids": [
10749,
18
],
"id": 310888,
"original_title": "Southside With You",
"original_language": "en",
"title": "Southside With You",
"backdrop_path": "/fukREcpoPugi0yx6cVrFvsR7JBE.jpg",
"popularity": 5.229414,
"vote_count": 13,
"video": false,
"vote_average": 3.12
},
{
"poster_path": "/wJXku1YhMKeuzYNEHux7XtaYPsE.jpg",
"adult": false,
"overview": "Based on a true story, “War Dogs” follows two friends in their early 20s living in Miami during the first Iraq War who exploit a little-known government initiative that allows small businesses to bid on U.S. Military contracts. Starting small, they begin raking in big money and are living the high life. But the pair gets in over their heads when they land a 300 million dollar deal to arm the Afghan Military—a deal that puts them in business with some very shady people, not the least of which turns out to be the U.S. Government.",
"release_date": "2016-08-18",
"genre_ids": [
10752,
35,
18
],
"id": 308266,
"original_title": "War Dogs",
"original_language": "en",
"title": "War Dogs",
"backdrop_path": "/2cLndRZy8e3das3vVaK3BdJfRIi.jpg",
"popularity": 5.186717,
"vote_count": 55,
"video": false,
"vote_average": 5.08
},
{
"poster_path": "/e9Rzr8Hhu3pqdJtdDLC52PerLk1.jpg",
"adult": false,
"overview": "Pete is a mysterious 10-year-old with no family and no home who claims to live in the woods with a giant, green dragon named Elliott. With the help of Natalie, an 11-year-old girl whose father Jack owns the local lumber mill, forest ranger Grace sets out to determine where Pete came from, where he belongs, and the truth about this dragon.",
"release_date": "2016-08-10",
"genre_ids": [
12,
10751,
14
],
"id": 294272,
"original_title": "Pete's Dragon",
"original_language": "en",
"title": "Pete's Dragon",
"backdrop_path": "/AaRhHX0Jfpju0O6hNzScPRgX9Mm.jpg",
"popularity": 4.93384,
"vote_count": 72,
"video": false,
"vote_average": 4.85
},
{
"poster_path": "/pXqnqw4V1Rly2HEacfl07d5DcUE.jpg",
"adult": false,
"overview": "59 year-old Ove is the block’s grumpy man. Several years ago he was deposed as president of the condominium association, but he could not give a damn about being deposed and therefore keeps looking over the neighborhood with an iron fist. When pregnant Parvaneh and her family move into the terraced house opposite Ove and accidentally back into Ove’s mailbox it sets off the beginning of an unexpected change in his life.",
"release_date": "2016-08-26",
"genre_ids": [
35,
18
],
"id": 348678,
"original_title": "En man som heter Ove",
"original_language": "sv",
"title": "A Man Called Ove",
"backdrop_path": "/o3PDMTyyMOGFNtze7YsfdWeMKpm.jpg",
"popularity": 4.790786,
"vote_count": 27,
"video": false,
"vote_average": 5.57
},
{
"poster_path": "/3Kr9CIIMcXTPlm6cdZ9y3QTe4Y7.jpg",
"adult": false,
"overview": "In the epic fantasy, scruffy, kindhearted Kubo ekes out a humble living while devotedly caring for his mother in their sleepy shoreside village. It is a quiet existence – until a spirit from the past catches up with him to enforce an age-old vendetta. Suddenly on the run from gods and monsters, Kubo’s chance for survival rests on finding the magical suit of armor once worn by his fallen father, the greatest samurai the world has ever known. Summoning courage, Kubo embarks on a thrilling odyssey as he faces his family’s history, navigates the elements, and bravely fights for the earth and the stars.",
"release_date": "2016-08-18",
"genre_ids": [
12,
16,
14,
10751
],
"id": 313297,
"original_title": "Kubo and the Two Strings",
"original_language": "en",
"title": "Kubo and the Two Strings",
"backdrop_path": "/akd0Z0OiR20btITvmvweDcJ3m8H.jpg",
"popularity": 4.572192,
"vote_count": 34,
"video": false,
"vote_average": 6.93
},
{
"poster_path": "/rxXA5vwJElXQ8BgrB0pocUcuqFA.jpg",
"adult": false,
"overview": "When Rebecca left home, she thought she left her childhood fears behind. Growing up, she was never really sure of what was and wasn’t real when the lights went out…and now her little brother, Martin, is experiencing the same unexplained and terrifying events that had once tested her sanity and threatened her safety. A frightening entity with a mysterious attachment to their mother, Sophie, has reemerged.",
"release_date": "2016-07-22",
"genre_ids": [
27
],
"id": 345911,
"original_title": "Lights Out",
"original_language": "en",
"title": "Lights Out",
"backdrop_path": "/mK9KdQj5Z6CAtxnFu2XPO8m78Il.jpg",
"popularity": 4.483865,
"vote_count": 133,
"video": false,
"vote_average": 6.11
},
{
"poster_path": "/3mCcVbVLz23MhCngELFihX2uSwb.jpg",
"adult": false,
"overview": "XOXO follows six strangers whose lives collide in one frenetic, dream-chasing, hopelessly romantic night.",
"release_date": "2016-08-26",
"genre_ids": [
18
],
"id": 352492,
"original_title": "XOXO",
"original_language": "en",
"title": "XOXO",
"backdrop_path": "/dP3bxMPEDc9eNN2nH9P5YyhS27p.jpg",
"popularity": 4.478293,
"vote_count": 4,
"video": false,
"vote_average": 7
},
{
"poster_path": "/zm0ODjtfJfJW0W269LqsQl5OhJ8.jpg",
"adult": false,
"overview": "As Batman hunts for the escaped Joker, the Clown Prince of Crime attacks the Gordon family to prove a diabolical point mirroring his own fall into madness. Based on the graphic novel by Alan Moore and Brian Bolland.",
"release_date": "2016-07-24",
"genre_ids": [
28,
16,
80,
18
],
"id": 382322,
"original_title": "Batman: The Killing Joke",
"original_language": "en",
"title": "Batman: The Killing Joke",
"backdrop_path": "/7AxMc1Mgm3xD2lySdM6r0sQGS3s.jpg",
"popularity": 4.136973,
"vote_count": 141,
"video": false,
"vote_average": 5.91
},
{
"poster_path": "/4J2Vc32juKTSdqm273HDKHsWO42.jpg",
"adult": false,
"overview": "A weekend getaway for four couples takes a sharp turn when one of the couples discovers the entire trip was orchestrated to host an intervention on their marriage.",
"release_date": "2016-08-26",
"genre_ids": [
35,
18
],
"id": 351242,
"original_title": "The Intervention",
"original_language": "en",
"title": "The Intervention",
"backdrop_path": "/xvghzVFYDJd26Txy2s0rHORrXIi.jpg",
"popularity": 4.113746,
"vote_count": 7,
"video": false,
"vote_average": 3.79
},
{
"poster_path": "/eZJYbODPWMRe6aQ1KtKHMb5ZOnx.jpg",
"adult": false,
"overview": "The adventures of teenager Max McGrath and alien companion Steel, who must harness and combine their tremendous new powers to evolve into the turbo-charged superhero Max Steel.",
"release_date": "2016-08-26",
"genre_ids": [
878,
28,
12
],
"id": 286567,
"original_title": "Max Steel",
"original_language": "en",
"title": "Max Steel",
"backdrop_path": "/9bM4Est3pyXPLr1vF2o5BiRtp0L.jpg",
"popularity": 3.541536,
"vote_count": 9,
"video": false,
"vote_average": 4.22
},
{
"poster_path": "/v0krYaMdqD9uxFuFiWhEyKKIaw5.jpg",
"adult": false,
"overview": "Elite snipers Brandon Beckett (Chad Michael Collins) and Richard Miller (Billy Zane) tasked with protecting a gas pipeline from terrorists looking to make a statement. When battles with the enemy lead to snipers being killed by a ghost shooter who knows their exact location, tensions boil as a security breach is suspected. Is there someone working with the enemy on the inside? Is the mission a front for other activity? Is the Colonel pulling the strings?",
"release_date": "2016-08-02",
"genre_ids": [
28,
18,
10752
],
"id": 407375,
"original_title": "Sniper: Ghost Shooter",
"original_language": "en",
"title": "Sniper: Ghost Shooter",
"backdrop_path": "/yYS8wtp7PgRcugt6EUMhv95NnaK.jpg",
"popularity": 3.504234,
"vote_count": 17,
"video": false,
"vote_average": 4.76
},
{
"poster_path": "/c4mvBk9cRAkyp9DpzlOBSmeuzG6.jpg",
"adult": false,
"overview": "Summer, New York City. A college girl falls hard for a guy she just met. After a night of partying goes wrong, she goes to wild extremes to get him back.",
"release_date": "2016-08-26",
"genre_ids": [
18
],
"id": 336011,
"original_title": "White Girl",
"original_language": "en",
"title": "White Girl",
"backdrop_path": "/dxUxtnxeMsI0jCUFAT6GbgyUdiz.jpg",
"popularity": 3.485193,
"vote_count": 8,
"video": false,
"vote_average": 1.88
},
{
"poster_path": "/1SWIUZp4Gi2B6VxajpPWKhkbTMF.jpg",
"adult": false,
"overview": "The legendary Roberto Duran and his equally legendary trainer Ray Arcel change each other's lives.",
"release_date": "2016-08-26",
"genre_ids": [
18
],
"id": 184341,
"original_title": "Hands of Stone",
"original_language": "en",
"title": "Hands of Stone",
"backdrop_path": "/pqRJD5RE5DgRQ1Mq4kSZHmMjozn.jpg",
"popularity": 3.474028,
"vote_count": 16,
"video": false,
"vote_average": 3.75
}
],
"dates": {
"maximum": "2016-09-01",
"minimum": "2016-07-21"
},
"total_pages": 33,
"total_results": 649
}
You see that it is wrapped in a results object. So, you would need something like this:
public class RootObject
{
public NowPlaying[] Results { get; set; }
}
And deserialize into the RootObject. A great tool to get the structure of a JSON object is quicktype.io. Or, it is even baked into Visual Studio (Windows only). Copy your JSON object and go to Edit > Paste special > Paste JSON as Classes
Related
Nested JSON file save SQL Server as one record.
How to design hierarchy model in one table?
{
"SSAAResponse": {
"TheCTerRegRequest": {
"ParentCompanyRegOrgE": "",
"StartMonth": 1,
"TheCTerRegRequestNoticesList": [
{
"CreateDateTime": "1397/11/02-12:09",
"NoticeType": 6,
"RequestNoticeText": "Language Journal offers 6 or 7 essays or research studies per quarterly issue, a professional calendar of events and news, a listing of relevant articles in other journals, an annual survey of doctoral degrees in all areas concerning foreign and second languages, and reviews of scholarly books, textbooks, videotapes, and software."
},
{
"CreateDateTime": "1397/11/01-10:36",
"NoticeType": 10,
"RequestNoticeText": "c version of The Modern Language Journal is available at"
},
{
"CreateDateTime": "1397/10/29-09:18",
"NoticeType": 8,
"RequestNoticeText": "A board of directors for a company composed entirely of one gender or race
Before Civil Rights laws, public schools in the South admitted only white studentsشاه"
}
],
"TheReceiveUnit": {
"UnitName": "Strategies That",
"State": 1,
"Code": "16519"
},
"TheCTerRegRequestNamesList": [
{
"Name": "Corp 1",
"status": 2,
"Seqnumber": 4
},
{
"Name": "Corp 2",
"status": 2,
"Seqnumber": 5
},
{
"Name": "Corp 3",
"status": 2,
"Seqnumber": 3
},
{
"Name": "Corp 4",
"status": 4,
"Seqnumber": 1
},
{
"Name": "Corp 5",
"status": 2,
"Seqnumber": 2
}
],
"TheCTerRegRequestNewspaperList": [
{
"TheGNewspaper": {
"State": 2,
"Code": "0352",
"Title": "آواي کرمانشاه"
}
}
],
"ApplicantNationalCode": "3240953501",
"SignBookMobileNumber4SMS": "",
"TheCTerRegRequestStocksList": [],
"FounderMember": "",
"CapitalDescription": "",
"TheCTerRegRequestDefectsList": [],
"MinuteStartTime": "12:00",
"DirectMemberMinuteDate": "1397/10/25",
"MinuteDate": "1397/10/25",
"ParentCompanyPublicNumber": "",
"Declaration": "programs delivering customized professional development. A former master teacher, she has been in education for more than 25 years and works with administrators and teachers in groups of varying sizes from kindergarten through high school. She is the author of Complex Text Decoded: ",
"EmaiLAddress": "",
"OwnerShipType": 1,
"CreateDateTime": "1397/10/26-11:33",
"SignBookFamily": "مژگاني",
"ParentCompanyRegOrg": "",
"TheCTerRegRequestRejectReasonsList": [
{
"RejectDesc": "Kathy Glass consults nationally with schools and districts, presents at conferences, and teaches seminars for university and county",
"RejectDateTime": "1397/11/02-11:58",
"TheCIMinutesRejectType": {
"State": 1,
"Code": "004",
"Title": "Kathy Glass consults nationally with schools and districts, presents at conferences, and teaches seminars for university and county"
}
}
],
"TotalCapital": 1000000,
"SignBookLawyerState": 1,
"ApplicantFirstName": "کسري",
"AfterRegNationalCode": "",
"InvitationLetterNumber": "",
"TheCIInstitutionType": {},
"DirectorMember": "",
"TheCTerRegRequestPersonList": [
{
"CapitalStatus": 2,
"FirstNameFA": "mostafa",
"LastNameFA": "sholeh",
"FatherNameLA": "",
"PhoneNumber": "083-37225212",
"RecordNo": "",
"FirstNameLA": "",
"MobileNumber4SMS": "09904040946",
"TheCTerRegRequestPersonStocksList": [
{
"AmountStocks": 500000,
"TheCISharesType": {
"State": 1,
"Code": "005",
"Title": "cash"
}
}
],
"BirthDateSH": "1371/11/05",
"PersonType": 1,
"PostCode": "6713945936",
"Address": "3634 N Fm 2869, Winnsboro, TX, 75494 ",
"FatherNameFA": "amir",
"TheCICompanyType": {},
"NationalityCode": "3240953501",
"ExternalNationalStatus": 1,
"LastNameLA": "",
"IdentityNo": "3240953501",
"TheCTerRegRequestPersonPostsList": [
{
"EndDateValidity": "1398/10/25",
"Description": "",
"TheCIPostType": {
"State": 1,
"Code": "004",
"Title": "Director"
},
"StartDate": "1397/10/25",
"IsNonPartnership": 2,
"PeriodTime": 1,
"PostTitle": "",
"IsNonDirectMember": 2
},
{
"EndDateValidity": "1398/10/25",
"Description": "",
"TheCIPostType": {
"State": 1,
"Code": "001",
"Title": "Boss"
},
"StartDate": "1397/10/25",
"IsNonPartnership": 2,
"PeriodTime": 1,
"PostTitle": "",
"IsNonDirectMember": 2
}
],
"Sex": 2
},
{
"CapitalStatus": 2,
"FirstNameFA": "mahdi",
"LastNameFA": "salefdkjf",
"FatherNameLA": "",
"PhoneNumber": "083-37225212",
"RecordNo": "",
"FirstNameLA": "",
"MobileNumber4SMS": "09189954983",
"TheCTerRegRequestPersonStocksList": [
{
"AmountStocks": 500000,
"TheCISharesType": {
"State": 1,
"Code": "005",
"Title": "cash"
}
}
],
"BirthDateSH": "1370/11/23",
"PersonType": 1,
"PostCode": "6713945936",
"Address": "3634 N Fm 2869, Winnsboro, TX, 75494 ",
"FatherNameFA": "mohamad",
"TheCICompanyType": {},
"NationalityCode": "3240739070",
"ExternalNationalStatus": 1,
"LastNameLA": "",
"IdentityNo": "3240739070",
"TheCTerRegRequestPersonPostsList": [
{
"EndDateValidity": "1398/10/25",
"Description": "",
"TheCIPostType": {
"State": 1,
"Code": "045",
"Title": "ghaem magham"
},
"StartDate": "1397/10/25",
"IsNonPartnership": 2,
"PeriodTime": 1,
"PostTitle": "",
"IsNonDirectMember": 2
},
{
"EndDateValidity": "1398/10/25",
"Description": "",
"TheCIPostType": {
"State": 1,
"Code": "002",
"Title": "boss heyat"
},
"StartDate": "1397/10/25",
"IsNonPartnership": 2,
"PeriodTime": 1,
"PostTitle": "",
"IsNonDirectMember": 2
}
],
"Sex": 2
}
],
"ApplicantLastNameEn": "",
"ActivityTimeState": 2,
"TheObjectState": {
"StateType": 2,
"Code": "001126",
"Title": "تadmin"
},
"SignBookDate": "",
"WebAddress": "",
"FaxNumber": "",
"AfterRegRegisterDate": "",
"CashCapital": 1000000,
"RequestNoticeText": "Interest in the relations between discourse and
(social) context has been limited mostly to sociolinguistics (Ammon, 2005) and
Critical Discourse Analysis (CDA)(Wodak, & Meyer, 2001). In these approaches,
a more or less direct link is established between social structures (for instance
conceptualized as social ‘variables’ such as gender, class or age in",
"SignBookFamilyEn": "",
"ParentCompanyRegisterDateM": "",
"Turn": 1,
"TheCTerRegRequestPledgedCapitalList": [],
"SignatureAuthorityDesc": "mostafa sholeh",
"ApplicantLastName": "sholeh",
"LicenseState": 1,
"ParentCompanyAddress": "",
"AfterRegName": "",
"ParentCompanyName": "",
"TheCTerRegRequestActivitiesList": [
{
"ActivityDesc": "Teaching this skill supports self-agency so students can define unfamiliar words independently"
}
],
"ParentCompanyRegisterDate": "",
"ParentCountryStatuteE": "",
"ApplicantNationalityType": 1,
"PostCode": "6713945936",
"ParentCompanyType": "",
"ParentCompanyLetterDate": "",
"ParentCompanyCurrency": "",
"RequestReceipt": "A refereed publication, The Modern Language Journal is dedicated to promoting scholarly exchange among teachers and researchers of all modern foreign languages and English as a second language. This journal publishes documented essays, quantitative and qualitative research studies, response articles, and editorials that challenge paradigms of language learning and teaching. The Modern Language Journal offers 6 or 7 essays or research studies per quarterly issue, a professional calendar of events and news, a listing of relevant articles in other journals, an annual survey of doctoral degrees in all areas concerning foreign and second languages, and reviews of scholarly books, textbooks, videotapes, and software. JSTOR provides a digital archive of the print version of The Modern Language Journal. The electronic version of The Modern Language Journal is available at http://www.interscience.wiley.com. Authorized users may be able to access the full text articles at this site. The Modern Language Journal also offers a fifth issue each year which alternates between a Focus Issue and a Monograph.",
"SignBookNationalityType": 1,
"CompanyLetter": "Wiley is a global provider of content and content-enabled workflow solutions in areas of scientific, technical, medical, and scholarly research; professional development; and education. Our core businesses produce scientific, technical, medical, and scholarly journals, reference works, books, database services, and advertising; professional books, subscription products, certification and training services and online applications; and education content and services including integrated online teaching and learning resources for undergraduate and graduate students and lifelong learners. Founded in 1807, John Wiley & Sons, Inc. has been a valued source of information and understanding for more than 200 years, helping people around the world meet their needs and fulfill their aspirations. Wiley has published the works of more than 450 Nobel laureates in all categories: Literature, Economics, Physiology or Medicine, Physics, Chemistry, and Peace. Wiley has partnerships with many of the world’s leading societies and publishes over 1,500 peer-reviewed journals and 1,500+ new books annually in print and online, as well as databases, major reference works and laboratory protocols in STMS subjects. With a growing open access offering, Wiley is committed to the widest possible dissemination of and access to the content we publish and supports all sustainable models of access. Our online platform, Wiley Online Library (wileyonlinelibrary.com) is one of the world’s most extensive multidisciplinary collections of online resources, covering life, health, social and physical sciences, and humanities.",
"PresenceDate": "",
"ApplicantPost": 1,
"SignBookNationalCode": "3240953501",
"SignBookPost": 1,
"SignBookLicenseDate": "",
"MinuteText": "umented essays, quantitative and qualitative research studies, response articles, and editorials that challenge paradigms of language learning and teaching. The Modern Language Journal offers 6 or 7 essays or research studies per quarterly issue, a professional calendar of events and news, a listing of relevant articles in other journals, an annual survey of doctoral degrees in all areas concerning foreign and second languages, and reviews of scholarly books, textbooks, videotapes, and software. JSTOR provides a digital archive of the print version of The Modern Language Journal. The electronic version of The Modern Language Journal is available at http://www.interscience.wiley.com. Authorized users may b",
"InvitationSessionTime": "",
"DirectMemberMinuteStartTime": "12:00",
"ParentCompanyLetterNumber": "",
"Statute": "Because youngsters with reading disabilities typically have problems involving poor phonological skills, they generally benefit from instructional approaches that provide highly explicit, systematic teaching of phonemic awareness and phonics. However, if children are taught systematic phonics in one part of the reading program but are encouraged to use context to guess at words when reading passages, they may not apply their phonics skills consistently. Thus, the phonics component of the reading program may be seriously undermined. Also, children must be placed for reading instruction in books that are a good match to their word identification accuracy and phonics skills. If they are placed in reading materials that are too difficult for their current skill levels, they may be left with few options other than guessing at words.
However, like normally-achieving readers, children with reading disabilities do benefit from encouragement to use context as an aid to comprehension. This kind of context use can occur when children are listening to text as well as when they are reading. For instance, in reading stories to children, teachers can encourage the use of sentence context or pictures to determine the meanings of unfamiliar words by modeling this process aloud: "Hmmm, what can I do if I am not sure what the word pale means? Well, the sentence says that D. W. put baby powder on her face to look pale, so I can think about what baby powder looks like…" Because youngsters with reading disabilities usually have listening comprehension that far outstrips their reading skills, oral comprehension activities often are the best ways to challenge and develop their comprehension abilities.",
"TheCTerRegRequestLicenseList": [],
"ApplicantBirthDate": "",
"AddressDesc": "he use of context in comprehension refers to something quite different from the use of context in word identification. Returning to the previous sentence about D.W.",
"FinancialCalenderType": 1,
"ApplicantFirstNameEn": "",
"DirectMemberMinuteText": "Black? Book? Box? (The guesses are often accompanied by more attention to the expression on the face of the teacher than to the print, as the child waits for this expression to change to indicate a correct guess.) Even when children are able to use context to arrive at the correct word, reliance on context to compensate for inaccurate or nonautomatic word reading creates a drain on comprehension. This kind of compensation becomes increasingly problematic as children are expected to read more challenging texts that have few or no pictures, sophisticated vocabulary, and grammatically complex sentences.",
"ParentCompanyNameE": "",
"NumOfDirectMember": 2,
"SignBookLicenseNo": "",
"FixPhoneNumber": "083-37225212",
"TheCTerRegRequestAdvertisingList": [],
"Authority": "",
"TheCICompanyType": {
"State": 1,
"Code": "001",
"Title": "Corp limited"
},
"SignBookBirthDate": "",
"SignBookNameEn": "",
"StartDay": 1,
"ActivityEndDate": "",
"SignBookName": "hamid",
"AccessNo": "3694361110607356378",
"ParentCountryStatute": "",
"TheCTerRegRequestBranchList": [],
"TheCTerRegRequestStatuteList": [
{
"Description": "phonics skills to decode occasional unknown words rapidly.",
"Clause": 0,
"Note": 0,
"Article": 2
},
{
"Description": "systems" to read words. Skilled readers do not need to rely on pictures or sentence context in word identification, because they can read most words automatically",
"Clause": 0,
"Note": 0,
"Article": 3
},
{
"Description": "increasingly accurate and automatic word identification skills, ",
"Clause": 0,
"Note": 1,
"Article": 3
},
{
"Description": "Scientific evidence strongly demonstrates that the development of skilled reading involves",
"Clause": 0,
"Note": 0,
"Article": 4
},
{
"Description": "When children encounter an unfamiliar word in reading, they may make use of context cues, that is, information from pictures or from sentences surrounding the unknown word.",
"Clause": 0,
"Note": 0,
"Article": 5
},
{
"Description": "monitor their reading to see if it was accurate",
"Clause": 0,
"Note": 0,
"Article": 6
},
{
"Description": "select the information that they need to focus on",
"Clause": 0,
"Note": 0,
"Article": 7
},
{
"Description": "Unfortunately for many students, choosing effective strategies does not come automatically. Often, students who have difficulty reading simply browse or skim through texts without a specific strategy in mind because they don’t have a clear reason for reading. ",
"Clause": 0,
"Note": 0,
"Article": 8
},
{
"Description": "For example, a situation that involves understanding and recalling details requires a different set of strategies from a situation where the reader is seeking specific information but memorization is not necessary.",
"Clause": 0,
"Note": 1,
"Article": 8
},
{
"Description": "Some students will do leisure reading because they are interested in a particular topic.",
"Clause": 0,
"Note": 0,
"Article": 9
},
{
"Description": " In fact, students may read a variety of texts for enjoyment: newspapers or magazines",
"Clause": 0,
"Note": 0,
"Article": 10
},
{
"Description": "Functional reading is what students will need to do all the time to get things done at school, at work and in their everyday lives. ",
"Clause": 0,
"Note": 0,
"Article": 11
},
{
"Description": "It may seem that only functional reading is important,",
"Clause": 0,
"Note": 0,
"Article": 12
},
{
"Description": "Students can learn to recognize contexts of reading and choose appropriate strategies through teacher-guided practice and reflection on the reading they do in various situations for various purposes.",
"Clause": 0,
"Note": 0,
"Article": 13
},
{
"Description": "Unfortunately for many students, choosing effective strategies does not come automatically. ",
"Clause": 0,
"Note": 0,
"Article": 14
},
{
"Description": "Teaching students about contexts of reading will help them be more confident and strategic in their reading",
"Clause": 0,
"Note": 0,
"Article": 15
},
{
"Description": "Contexts of reading are all the elements that influence how we read in different situations. The context includes: 1) the setting, 2) the text, and 3) the purpose for reading. There are two main types of reading contexts. In leisure contexts we choose to read for our own interest, pleasure or entertainment..",
"Clause": 0,
"Note": 0,
"Article": 16
},
{
"Description": "i am a teacher",
"Clause": 0,
"Note": 0,
"Article": 17
},
{
"Description": "i am a student",
"Clause": 0,
"Note": 0,
"Article": 18
},
{
"Description": "i am a student",
"Clause": 0,
"Note": 0,
"Article": 19
},
{
"Description": "asds was a replace",
"Clause": 0,
"Note": 0,
"Article": 20
},
{
"Description": "fghqwr hgfiqehk ewrjgfoqhg krjg",
"Clause": 0,
"Note": 0,
"Article": 21
},
{
"Description": "lkrdhgkhkhkfdg rtgerg wt,
"Clause": 0,
"Note": 0,
"Article": 22
},
{
"Description": "dgwejrfgjwegfk rgjwle ertehrgho",
"Clause": 0,
"Note": 0,
"Article": 23
},
{
"Description": "erewktlkrewhjgkw rkgjwgjkl",
"Clause": 0,
"Note": 0,
"Article": 24
},
{
"Description": "safddf dkjhaskjfgjka eirhweyhi",
"Clause": 0,
"Note": 0,
"Article": 25
},
{
"Description": "Test",
"Clause": 0,
"Note": 0,
"Article": 26
},
{
"Description": "test",
"Clause": 0,
"Note": 0,
"Article": 1
}
],
"ApplicantMobileNumber4SMS": "09904040946",
"FinalAcceptanceDate": "1397/10/27",
"Name": "test Corp",
"ParentCompanyAgentAuthority": "",
"AuthorityE": "",
"InvitationSessionDate": "",
"TheCTerRegRequestClusterGroupList": []
},
"Result": {
"Description": "send successful",
"Successful": true,
"Message": "423424",
"No": "-1",
"Code": "1000"
}
},
"CBIResponse": {
"respCode": 0,
"accessNo": "3694361110607356378"
}
}
I designed like below image:
below design is true?
USE [NFC]
GO
/****** Object: Table [dbo].[tbl_NFCInquiryStructure] Script Date: 2021-09-04 09:42:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tbl_NFCInquiryStructure](
[ID] [int] IDENTITY(1,1) NOT NULL,
[NodeName] [nvarchar](500) NULL,
[ParentId] [int] NULL,
[IsValue] [bit] NULL
) ON [PRIMARY]
GO
It shows table design that I guess that's right. Contains the parent field.
Is true?
I want to implement this hierarchical file in a table.
Help me please
I am trying to access the 'title' from the following list but it keeps throwing error.
var moviesDB = {
"genres": [
"Comedy",
"Fantasy",
"Crime",
"Drama",
"Music",
"Adventure",
"History",
"Thriller",
"Animation",
"Family",
"Mystery",
"Biography",
"Action",
"Film-Noir",
"Romance",
"Sci-Fi",
"War",
"Western",
"Horror",
"Musical",
"Sport"
],
"movies": [
{
"id": 1,
"title": "Beetlejuice",
"year": "1988",
"runtime": "92",
"genres": ["Comedy", "Fantasy"],
"director": "Tim Burton",
"actors": "Alec Baldwin, Geena Davis, Annie McEnroe, Maurice Page",
"plot":
"A couple of recently deceased ghosts contract the services of a \"bio-exorcist\" in order to remove the obnoxious new owners of their house.",
"posterUrl":
"https://images-na.ssl-images-amazon.com/images/M/MV5BMTUwODE3MDE0MV5BMl5BanBnXkFtZTgwNTk1MjI4MzE#._V1_SX300.jpg"
},
{
"id": 2,
"title": "The Cotton Club",
"year": "1984",
"runtime": "127",
"genres": ["Crime", "Drama", "Music"],
"director": "Francis Ford Coppola",
"actors": "Richard Gere, Gregory Hines, Diane Lane, Lonette McKee",
"plot":
"The Cotton Club was a famous night club in Harlem. The story follows the people that visited the club, those that ran it, and is peppered with the Jazz music that made it so famous.",
"posterUrl":
"https://images-na.ssl-images-amazon.com/images/M/MV5BMTU5ODAyNzA4OV5BMl5BanBnXkFtZTcwNzYwNTIzNA##._V1_SX300.jpg"
},
]
}
I can go as far as moviesDB["movies"][0] but cannot get the title property.
Although I can do the same in Javascript and it works with no errors.
console.log(moviesDB["movies"][0]["title"]);
Any solution for this?
You need to make a cast on the element of your movie list.
print((moviesDB['movies'][0] as Map<String, dynamic>)['title']);
I know that I'm able to get the links to an article using this in my API request.
My problem is regarding the cases of inclusion. By asking for the links to a specific article, I'm also getting the links in all of the navigation templates which are included at the bottom of the article.
For example, after asking for the links to this article:
https://en.wikipedia.org/w/api.php?action=query&titles=St%C3%A9phane_Sess%C3%A8gnon&prop=linkshere
I'm also getting the links which appear at the bottom of the page, in the navigation templates:
I'm building an app which uses the mobile version of Wikipedia, so the navigation templates at the bottom of the pages are not relevant for my goal, because they are not shown in the mobile version.
I'd like to exclude those links from the result someway. I want to get only the links which actually appears in an article body, or at least detect whether they are from a template or not. Is this possible?
Are you aware that there is a mobile API? It does various transformations on the article to make it more appropriate for small-screen devices, including the removal of most navigation templates. For example:
https://en.wikipedia.org/api/rest_v1/page/mobile-sections/Fort_Horsted
{
"lead": {
"ns": 0,
"id": 35265226,
"revision": "803745099",
"lastmodified": "2017-10-04T10:37:41Z",
"lastmodifier": {
"user": "InternetArchiveBot",
"gender": "unknown"
},
"displaytitle": "Fort Horsted",
"normalizedtitle": "Fort Horsted",
"wikibase_item": "Q5471353",
"protection": {},
"editable": true,
"languagecount": 0,
"image": {
"file": "The_British_Army_in_the_United_Kingdom_1939-45_H5865.jpg",
"urls": {
"320": "https://upload.wikimedia.org/wikipedia/commons/e/e1/The_British_Army_in_the_United_Kingdom_1939-45_H5865.jpg",
"640": "https://upload.wikimedia.org/wikipedia/commons/e/e1/The_British_Army_in_the_United_Kingdom_1939-45_H5865.jpg",
"800": "https://upload.wikimedia.org/wikipedia/commons/e/e1/The_British_Army_in_the_United_Kingdom_1939-45_H5865.jpg",
"1024": "https://upload.wikimedia.org/wikipedia/commons/e/e1/The_British_Army_in_the_United_Kingdom_1939-45_H5865.jpg"
}
},
"hatnotes": [],
"geo": {
"latitude": 51.358,
"longitude": 0.513
},
"sections": [
{
"id": 0,
"text": "<span><p><b>Fort Horsted</b> is a scheduled monument (Monument Number 416040) that lies in the Horsted Valley to the South of Chatham, Kent, England. It is a late 19th-century Land Fort, and one of six constructed around Chatham and Gillingham, Kent to protect HM Dockyard Chatham from attack. Originally proposed in the Royal Commission on the Defence of the United Kingdom Report, published in 1860, it and the other land defences were omitted as part of general cost cutting with only the coastal defences on the River Medway being retained and completed under the original 1860 proposals. It was not until the mid-1870s that a revised program was accepted, which included the construction of a convict prison at Borstal, Rochester, to provide low cost labour for the construction of a line of four forts, Fort Borstal, Fort Bridgewood, Fort Horsted and Fort Luton (a further three forts were constructed with the use of convict labour). Its construction started in 1879 and was complete by 1889 after much delay.</p></span><figure class=\"mw-default-size\" id=\"mwAg\"><img src=\"//upload.wikimedia.org/wikipedia/commons/thumb/e/e1/The_British_Army_in_the_United_Kingdom_1939-45_H5865.jpg/220px-The_British_Army_in_the_United_Kingdom_1939-45_H5865.jpg\" data-file-type=\"bitmap\" height=\"163\" width=\"220\" srcset=\"//upload.wikimedia.org/wikipedia/commons/thumb/e/e1/The_British_Army_in_the_United_Kingdom_1939-45_H5865.jpg/440px-The_British_Army_in_the_United_Kingdom_1939-45_H5865.jpg 2x, //upload.wikimedia.org/wikipedia/commons/thumb/e/e1/The_British_Army_in_the_United_Kingdom_1939-45_H5865.jpg/330px-The_British_Army_in_the_United_Kingdom_1939-45_H5865.jpg 1.5x\"><figcaption>A QF 12-pounder 12 cwt AA gun mounted on Albion BY-series truck, December 1940</figcaption></figure>\n<p class=\"skipped\"><span style=\"font-size: small;\"></span></p>\n\n\n\n"
},
{
"id": 1,
"toclevel": 1,
"anchor": "Materials",
"line": "Materials"
},
{
"id": 2,
"toclevel": 1,
"anchor": "Armaments",
"line": "Armaments"
},
{
"id": 3,
"toclevel": 1,
"anchor": "World_wars",
"line": "World wars"
},
{
"id": 4,
"toclevel": 1,
"anchor": "The_name",
"line": "The name"
},
{
"id": 5,
"toclevel": 1,
"anchor": "The_fort_today",
"line": "The fort today"
},
{
"id": 6,
"toclevel": 1,
"anchor": "References",
"line": "References"
},
{
"id": 7,
"toclevel": 1,
"anchor": "External_links",
"line": "External links"
}
]
},
"remaining": {
"sections": [
{
"id": 1,
"text": "\n<p>The fort was constructed almost entirely of concrete, topped with chalk and earth with no visible concrete exposed from the outside, except from the gorge or rear of the fort. The ditch was protected by two single and one double counterscarp galleries.</p>\n\n",
"toclevel": 1,
"line": "Materials",
"anchor": "Materials"
},
{
"id": 2,
"text": "\n<p>Although the original plans of the fort proposed fixed armament, by its completion there had been a shift away from fixed armament to moveable guns. The fort would not been armed, unless actual threat materialised and then with moveable field artillery. In the event of actual invasion and an attack on HM Dockyard Chatham, additional field defence would have augmented the forts, with trenches and battery positions. In fact in 1907 during summer manoeuvres such defences were probably constructed.</p>\n\n",
"toclevel": 1,
"line": "Armaments",
"anchor": "Armaments"
},
{
"id": 3,
"text": "\n<p>Deemed to have become obsolete by 1910, the fort formed part of Chatham's land defences in both World Wars. In World War I brick emplacements and a pillbox were built on the ramparts, and fixed anti-aircraft guns of an early type were installed (possibly 12pdr coastal defence guns on improvised high angle mountings, not be confused with the later naval version).</p>\n\n",
"toclevel": 1,
"line": "World wars",
"anchor": "World_wars"
},
{
"id": 4,
"text": "\n<p>The fort was named after a local hamlet. Horsted is speculated to have been named after the legendary Saxon warrior Horsa, who was killed at nearby Aylesford while fighting the Britons.<span class=\"mw-ref\" id=\"cite_ref-1\"><span class=\"mw-reflink-text\">[1]</span></span></p>\n\n",
"toclevel": 1,
"line": "The name",
"anchor": "The_name"
},
{
"id": 5,
"text": "\n<p>The fort survives relatively intact and is currently in use as a business park. While it is in relatively good condition, its commercial use has seen some new construction and modification which has seen the significant loss of the original structure and features.</p>\n\n",
"toclevel": 1,
"line": "The fort today",
"anchor": "The_fort_today"
},
{
"id": 6,
"text": "\n<div class=\"mw-references-wrap\"><ol class=\"mw-references references\"><li id=\"cite_note-1\"> <span id=\"mw-reference-text-cite_note-1\" class=\"mw-reference-text\"><cite class=\"citation web\" id=\"mwLA\"><a rel=\"mw:ExtLink\" href=\"https://www.britannica.com/topic/Hengist\" class=\"external\">\"Hengist and Horsa\"</a>. Encyclopædia Britannica.</cite></span></li></ol></div>\n\n\n",
"toclevel": 1,
"line": "References",
"anchor": "References",
"isReferenceSection": true
},
{
"id": 7,
"text": "\n<ul><li> <a rel=\"mw:ExtLink\" href=\"http://www.ecastles.co.uk/chatham.html\" class=\"external\">Map of Chatham's defences</a></li>\n<li> <a rel=\"mw:ExtLink\" href=\"http://www.forthorsted.co.uk/content/history\" class=\"external\">Fort Horsted website history page</a></li>\n<li> <a rel=\"mw:ExtLink\" href=\"https://web.archive.org/web/20120410012117/http://www.undergroundkent.co.uk/fort_horsted.htm\" class=\"external\">Fort Horsted on the Underground Kent website</a> Dead Link</li>\n<li> <a rel=\"mw:ExtLink\" href=\"http://www.pastscape.org.uk/hob.aspx?hob_id=416040&sort=2&type=&rational=a&class1=1&period=None&county=693349&district=786118&parish=None&place=chatham&recordsperpage=10&source=text&rtype=&rnumber=&p=2&move=n&nor=39&recfc=0\" class=\"external\">Pastscape Record Fort Horstead</a></li></ul>\n\n<div role=\"navigation\" class=\"navbox\" aria-labelledby=\"Forts_in_Medway\" style=\"padding:3px\"><table class=\"nowraplinks collapsible autocollapse navbox-inner\" style=\"border-spacing:0;background:transparent;color:inherit\"><tbody><tr><th scope=\"col\" class=\"navbox-title\" colspan=\"2\" style=\"background:lightsteelblue;\"><div class=\"plainlinks hlist navbar mini\"><ul><li class=\"nv-view\"><abbr style=\";background:lightsteelblue;;background:none transparent;border:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;\">v</abbr></li><li class=\"nv-talk\"><abbr style=\";background:lightsteelblue;;background:none transparent;border:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;\">t</abbr></li><li class=\"nv-edit\"><a rel=\"mw:ExtLink\" href=\"//en.wikipedia.org/w/index.php?title=Template:Defences_of_medway&action=edit\" class=\"external\"><abbr style=\";background:lightsteelblue;;background:none transparent;border:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;\">e</abbr></a></li></ul></div><div id=\"Forts_in_Medway\" style=\"font-size:114%;margin:0 4em\">Forts in Medway</div></th></tr><tr><td colspan=\"2\" class=\"navbox-list navbox-odd hlist\" style=\"width:100%;padding:0px\"><div style=\"padding:0em 0.25em\">\n<dl><dt>Medieval</dt>\n<dd> Rochester Castle</dd></dl>\n\n<dl><dt>Tudor</dt>\n<dd> Upnor Castle</dd></dl>\n\n<dl><dt>17th century</dt>\n<dd> Cockham Wood Fort</dd>\n<dd> Fort Gillingham</dd></dl>\n\n<dl><dt>Inner Ring <span style=\"font-weight:normal;\">(Napoleonic)</span></dt>\n<dd> Fort Clarence</dd>\n<dd> Fort Pitt</dd>\n<dd> Fort Amherst</dd></dl>\n\n<dl><dt>Outer Ring <span style=\"font-weight:normal;\">(Palmerston)</span></dt>\n<dd> Fort Borstal</dd>\n<dd> Fort Bridgewood</dd>\n<dd> Fort Darland</dd>\n<dd> Fort Horsted</dd>\n<dd> Fort Luton</dd>\n<dd> Grange Redoubt</dd>\n<dd> Woodlands Redoubt</dd>\n<dd> Fort Hoo</dd>\n<dd> Fort Darnet</dd></dl>\n</div></td></tr></tbody></table></div>\n\n",
"toclevel": 1,
"line": "External links",
"anchor": "External_links"
}
]
}
}
(The response for Stéphane Sessègnon would be too large to include here.)
If you really just want the links, and only non-template ones, I don't think that's available. You can parse it yourself, using something like mwparserfromhell
This is a snippet of a JSON file that was returned by TMDB and I'm trying to access the title of every object. I've tried using the following methods like from this post How to access specific value from a nested array within an object array.
"results": [
{
"vote_count": 2358,
"id": 283366,
"video": false,
"vote_average": 6.5,
"title": "Miss Peregrine's Home for Peculiar Children",
"popularity": 20.662756,
"poster_path": "/AvekzUdI8HZnImdQulmTTmAZXrC.jpg",
"original_language": "en",
"original_title": "Miss Peregrine's Home for Peculiar Children",
"genre_ids": [
18,
14,
12
],
"backdrop_path": "/9BVHn78oQcFCRd4M3u3NT7OrhTk.jpg",
"adult": false,
"overview": "A teenager finds himself transported to an island where he must help protect a group of orphans with special powers from creatures intent on destroying them.",
"release_date": "2016-09-28"
},
{
"vote_count": 3073,
"id": 381288,
"video": false,
"vote_average": 6.8,
"title": "Split",
"popularity": 17.488396,
"poster_path": "/rXMWOZiCt6eMX22jWuTOSdQ98bY.jpg",
"original_language": "en",
"original_title": "Split",
"genre_ids": [
27,
53
],
"backdrop_path": "/4G6FNNLSIVrwSRZyFs91hQ3lZtD.jpg",
"adult": false,
"overview": "Though Kevin has evidenced 23 personalities to his trusted psychiatrist, Dr. Fletcher, there remains one still submerged who is set to materialize and dominate all the others. Compelled to abduct three teenage girls led by the willful, observant Casey, Kevin reaches a war for survival among all of those contained within him — as well as everyone around him — as the walls between his compartments shatter apart.",
"release_date": "2016-11-15"
},
var titles = results.map(function extract(item){return item.title})
The map function iterates through the array and builds the resulting array by applying the extract function on each item.
for (var i =0; i < obj.results.length; i++) {
console.log(obj.results[i].title);
}
First, we get the results key, and then, iterate over it since it is an array.
Results is nothing more than an array of objects, there's nothing nested.
You could use .forEach()
results.forEach(function(item){
console.log(item.title);
});
I'm trying to use the Google Custom API to search for a certain keyword however it seems that the returned JSON that contains the links to the websites which "match" my keyword are totally irrelevant to what I have searched. I have noticed that anything searched will return 80% domains which end with edu even though my keyword is gum guard for example.
I don't mind domains ending with edu however I thought this API returns the first websites that will get returned whenever I go to my Google Chrome and type gum guard (in my example). Searching for gum guard using Google in a browser returns several websites which are relevant (Amazon, etc ... The JSON returned by the API doesn't return Amazon nor does it return anything from the first page from the browser). This confirms the fact that the API doesn't actually return the websites that a simple Google search through the browser will.
Do I have to specify to the API to return what the browser will? What other API could I use to achieve what I'm looking for?
Here is the irrelevant json response from google
{
"kind": "customsearch#search",
"url": {
"type": "application/json",
"template": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&cref={cref?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&c2coff={disableCnTwTranslation?}&hq={hq?}&hl={hl?}&siteSearch={siteSearch?}&siteSearchFilter={siteSearchFilter?}&exactTerms={exactTerms?}&excludeTerms={excludeTerms?}&linkSite={linkSite?}&orTerms={orTerms?}&relatedSite={relatedSite?}&dateRestrict={dateRestrict?}&lowRange={lowRange?}&highRange={highRange?}&searchType={searchType}&fileType={fileType?}&rights={rights?}&imgSize={imgSize?}&imgType={imgType?}&imgColorType={imgColorType?}&imgDominantColor={imgDominantColor?}&alt=json"
},
"queries": {
"nextPage": [
{
"title": "Google Custom Search - gum guards",
"totalResults": "2710000",
"searchTerms": "gum guards",
"count": 10,
"startIndex": 11,
"inputEncoding": "utf8",
"outputEncoding": "utf8",
"safe": "off",
"cx": "017576662512468239146:omuauf_lfve"
}
],
"request": [
{
"title": "Google Custom Search - gum guards",
"totalResults": "2710000",
"searchTerms": "gum guards",
"count": 10,
"startIndex": 1,
"inputEncoding": "utf8",
"outputEncoding": "utf8",
"safe": "off",
"cx": "017576662512468239146:omuauf_lfve"
}
]
},
"context": {
"title": "CS Curriculum",
"facets": [
[
{
"label": "lectures",
"anchor": "Lectures",
"label_with_op": "more:lectures"
}
],
[
{
"label": "assignments",
"anchor": "Assignments",
"label_with_op": "more:assignments"
}
],
[
{
"label": "reference",
"anchor": "Reference",
"label_with_op": "more:reference"
}
]
]
},
"searchInformation": {
"searchTime": 0.406893,
"formattedSearchTime": "0.41",
"totalResults": "2710000",
"formattedTotalResults": "2,710,000"
},
"items": [
{
"kind": "customsearch#result",
"title": "Decomposing an integer as sum of two squares",
"htmlTitle": "Decomposing an integer as sum of two squares",
"link": "https://www.cs.utexas.edu/users/EWD/ewd10xx/EWD1032.PDF",
"displayLink": "www.cs.utexas.edu",
"snippet": "DacompOSingL on 'ln}€q¢f' as gum OP 'I-wo squares. I \\J v. I (I had no\\' I'flcmned \n+0 wr'H-e .... which Sujjes} “we guard xg and “HG Fifi-her arm} so 'mhreshn _ ...",
"htmlSnippet": "DacompOSingL on 'ln}€q¢f' as \u003cb\u003egum\u003c/b\u003e OP 'I-wo squares. I \\J v. I (I had no\\' I'flcmned \u003cbr\u003e\n+0 wr'H-e .... which Sujjes} “we \u003cb\u003eguard\u003c/b\u003e xg and “HG Fifi-her arm} so 'mhreshn _ ...",
"cacheId": "6kLsXUvB8OcJ",
"mime": "application/pdf",
"fileFormat": "PDF/Adobe Acrobat",
"formattedUrl": "https://www.cs.utexas.edu/users/EWD/ewd10xx/EWD1032.PDF",
"htmlFormattedUrl": "https://www.cs.utexas.edu/users/EWD/ewd10xx/EWD1032.PDF",
"pagemap": {
"metatags": [
{
"moddate": "Fri Mar 3 06:46:07 2000",
"creator": "Adobe PageMaker 6.52",
"author": "Administrator",
"subject": "ewd1032",
"producer": "Acrobat Distiller 4.0 for Windows",
"creationdate": "Fri Mar 3 12:46:06 2000"
}
]
}
},
{
"kind": "customsearch#result",
"title": "Full Course Reader - Stanford University",
"htmlTitle": "Full Course Reader - Stanford University",
"link": "http://www.stanford.edu/class/cs106l/course-reader/full_course_reader.pdf",
"displayLink": "www.stanford.edu",
"snippet": "There are many ways to write include guards, but one ...... map, an atom, a gum, \na kit, a baleen, a gala, a ten, a don, a mural, a pan, a faun, a ducat, a pagoda ...",
"htmlSnippet": "There are many ways to write include \u003cb\u003eguards\u003c/b\u003e, but one ...... map, an atom, a \u003cb\u003egum\u003c/b\u003e, \u003cbr\u003e\na kit, a baleen, a gala, a ten, a don, a mural, a pan, a faun, a ducat, a pagoda ...",
"mime": "application/pdf",
"fileFormat": "PDF/Adobe Acrobat",
"formattedUrl": "www.stanford.edu/class/cs106l/course-reader/full_course_reader.pdf",
"htmlFormattedUrl": "www.stanford.edu/class/cs106l/course-reader/full_course_reader.pdf",
"pagemap": {
"cse_image": [
{
"src": "x-raw-image:///9d911bb58ab6b4c5a65ca944f233ed3f9a2190dfa2b61f975ad68a713143a787"
}
],
"cse_thumbnail": [
{
"width": "256",
"height": "197",
"src": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRciEJyvz3Cd2n9Pp3I0lhNxjVTKvKHuiT2npoRD9MXl2mvxCL9m2ZoSi4"
}
],
"metatags": [
{
"title": "CS106L Course Reader",
"author": "Keith Schwarz",
"creator": "Writer",
"producer": "OpenOffice.org 3.4",
"creationdate": "D:20130424224219-07'00'"
}
]
}
},
{
"kind": "customsearch#result",
"title": "The First World War Diary of Lupton Kaylor",
"htmlTitle": "The First World War Diary of Lupton Kaylor",
"link": "https://www.cs.utexas.edu/users/cline/LLK_Diary/LLK_Diary_The_War_with_Germanyold.pdf",
"displayLink": "www.cs.utexas.edu",
"snippet": "of work by not doing any fatigue1 or guard duty. The eats were much ...... \nReceived three gift[s] of goodies & tobacco, cigarettes & chewing gum from the “Y\n”,.",
"htmlSnippet": "of work by not doing any fatigue1 or \u003cb\u003eguard\u003c/b\u003e duty. The eats were much ...... \u003cbr\u003e\nReceived three gift[s] of goodies & tobacco, cigarettes & chewing \u003cb\u003egum\u003c/b\u003e from the “Y\u003cbr\u003e\n”,.",
"cacheId": "utxIYtTGiYcJ",
"mime": "application/pdf",
"fileFormat": "PDF/Adobe Acrobat",
"formattedUrl": "https://www.cs.utexas.edu/.../LLK_Diary_The_War_with_Germanyold.pdf",
"htmlFormattedUrl": "https://www.cs.utexas.edu/.../LLK_Diary_The_War_with_Germanyold.pdf",
"pagemap": {
"cse_image": [
{
"src": "x-raw-image:///53d8322fe2c384f82878a5fe26ac9abb9bd5537787e014be353f105168304940"
}
],
"cse_thumbnail": [
{
"width": "193",
"height": "261",
"src": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTR5evzfHcjXcQIyMwYFGMY8s30g02arz36cIXyn1ghRIu6QQ2NZ4-Umck"
}
],
"metatags": [
{
"creator": "diary.PUB - Microsoft Publisher",
"creationdate": "D:20041208121209",
"title": "C:\\Documents and Settings\\Alan Kaylor Cline\\My Documents\\Diary_LLK_The_War_with_Germany.pdf",
"author": "Alan Kaylor Cline",
"producer": "Acrobat PDFWriter 5.0 for Windows NT"
}
]
}
},
{
"kind": "customsearch#result",
"title": "Testing and Grading - EECS Instruction - University of California ...",
"htmlTitle": "Testing and Grading - EECS Instruction - University of California \u003cb\u003e...\u003c/b\u003e",
"link": "https://www-inst.eecs.berkeley.edu/~cs375/sp14/book/Tools_for_Teaching_2nd_Edition_PART_VIII_Testing_And_Grading.pdf",
"displayLink": "www-inst.eecs.berkeley.edu",
"snippet": "coded M & Ms for signaling answers and the use of a gum wrapper as a crib \nsheet. YouTube ...... dents ' names to increase objectivity and guard against bias.",
"htmlSnippet": "coded M & Ms for signaling answers and the use of a \u003cb\u003egum\u003c/b\u003e wrapper as a crib \u003cbr\u003e\nsheet. YouTube ...... dents ' names to increase objectivity and \u003cb\u003eguard\u003c/b\u003e against bias.",
"cacheId": "DbT9nrjcCOsJ",
"mime": "application/pdf",
"fileFormat": "PDF/Adobe Acrobat",
"formattedUrl": "https://www-inst.eecs.berkeley.edu/.../Tools_for_Teaching_2nd_Edition_ PART_VIII_Testing_And_Grading.pdf",
"htmlFormattedUrl": "https://www-inst.eecs.berkeley.edu/.../Tools_for_Teaching_2nd_Edition_ PART_VIII_Testing_And_Grading.pdf",
"pagemap": {
"metatags": [
{
"creationdate": "D:20140212112830",
"creator": "Google",
"producer": "Google"
}
]
}
},
{
"kind": "customsearch#result",
"title": "When such claims and litigation extend beyond the period , the ...",
"htmlTitle": "When such claims and litigation extend beyond the period , the \u003cb\u003e...\u003c/b\u003e",
"link": "http://cs.jhu.edu/~jason/465/hw-ofst/tagger/datahelp/entrain.withSA.txt",
"displayLink": "cs.jhu.edu",
"snippet": "A spot honoring Bill White , the inventor of chewing gum , shows a woman trying \n..... its pharmaceuticals subsidiary agreed to supply collagen corneal shields for ...",
"htmlSnippet": "A spot honoring Bill White , the inventor of chewing \u003cb\u003egum\u003c/b\u003e , shows a woman trying \u003cbr\u003e\n..... its pharmaceuticals subsidiary agreed to supply collagen corneal \u003cb\u003eshields\u003c/b\u003e for ...",
"cacheId": "FxEdWvhjFswJ",
"mime": "text/plain",
"formattedUrl": "cs.jhu.edu/~jason/465/hw-ofst/tagger/datahelp/entrain.withSA.txt",
"htmlFormattedUrl": "cs.jhu.edu/~jason/465/hw-ofst/tagger/datahelp/entrain.withSA.txt"
},
{
"kind": "customsearch#result",
"title": "greimlin 671 grianghrafad6ir greimlin, m. (gs. ~, pL ~i). Med ...",
"htmlTitle": "greimlin 671 grianghrafad6ir greimlin, m. (gs. ~, pL ~i). Med \u003cb\u003e...\u003c/b\u003e",
"link": "https://www.cs.tcd.ie/disciplines/intelligent_systems/clg/clg_web/L/LexSystem/NewIrishDictionaryDataandParser/dict68.txt",
"displayLink": "www.cs.tcd.ie",
"snippet": "... m = GUAJRE? guardal(l), ~ach GUAIRDEAI~L. -ACH guard~n = GUA!RNEAN \n.... Arb: Gum. Crann ~,gum-tree. ~arabach, gum arabic. '--'peirce, gutta-percha.",
"htmlSnippet": "... m = GUAJRE? guardal(l), ~ach GUAIRDEAI~L. -ACH \u003cb\u003eguard\u003c/b\u003e~n = GUA!RNEAN \u003cbr\u003e\n.... Arb: \u003cb\u003eGum\u003c/b\u003e. Crann ~,\u003cb\u003egum\u003c/b\u003e-tree. ~arabach, \u003cb\u003egum\u003c/b\u003e arabic. '--'peirce, gutta-percha.",
"cacheId": "62bdHC_BpNUJ",
"mime": "text/plain",
"formattedUrl": "https://www.cs.tcd.ie/disciplines/intelligent_systems/.../dict68.txt",
"htmlFormattedUrl": "https://www.cs.tcd.ie/disciplines/intelligent_systems/.../dict68.txt"
},
{
"kind": "customsearch#result",
"title": "a cappella,abbandono,accrescendo,affettuoso,agilmente,agitato ...",
"htmlTitle": "a cappella,abbandono,accrescendo,affettuoso,agilmente,agitato \u003cb\u003e...\u003c/b\u003e",
"link": "http://www.cse.ohio-state.edu/~wallacch/thesaurus",
"displayLink": "www.cse.ohio-state.edu",
"snippet": "... gestae,rose,sable,saltire,scutcheon,shield,spread eagle,step,stroke,stunt ...... ,\ngluten,glutenous,glutinose,glutinous,gooey,grumous,gum,gumbo,gumbolike ...",
"htmlSnippet": "... gestae,rose,sable,saltire,scutcheon,\u003cb\u003eshield\u003c/b\u003e,spread eagle,step,stroke,stunt ...... ,\u003cbr\u003e\ngluten,glutenous,glutinose,glutinous,gooey,grumous,\u003cb\u003egum\u003c/b\u003e,gumbo,gumbolike ...",
"mime": "text/plain",
"formattedUrl": "www.cse.ohio-state.edu/~wallacch/thesaurus",
"htmlFormattedUrl": "www.cse.ohio-state.edu/~wallacch/thesaurus"
},
{
"kind": "customsearch#result",
"title": "A Visual Modality for the Augmentation of Paper",
"htmlTitle": "A Visual Modality for the Augmentation of Paper",
"link": "http://www.acm.org/icmi/2001/PUI-2001/a2.pdf",
"displayLink": "www.acm.org",
"snippet": "name AG for “advanced guard.” The other feature structure ... odds of touching \nthe board (either by rubbing along the gum line or dabbing a point thereon) does\n ...",
"htmlSnippet": "name AG for “advanced \u003cb\u003eguard\u003c/b\u003e.” The other feature structure ... odds of touching \u003cbr\u003e\nthe board (either by rubbing along the \u003cb\u003egum\u003c/b\u003e line or dabbing a point thereon) does\u003cbr\u003e\n ...",
"cacheId": "N7tXMImzoFEJ",
"mime": "application/pdf",
"fileFormat": "PDF/Adobe Acrobat",
"formattedUrl": "www.acm.org/icmi/2001/PUI-2001/a2.pdf",
"htmlFormattedUrl": "www.acm.org/icmi/2001/PUI-2001/a2.pdf",
"pagemap": {
"cse_image": [
{
"src": "x-raw-image:///58b3bd5cddc8af4a254e5ff907bfcb937b19e788ad7b0d87dc939eeeba50e10d"
}
],
"cse_thumbnail": [
{
"width": "270",
"height": "186",
"src": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQv_rPdjW43AST6Pifq0F8l9EO76tn3k24etRsD9pN1Cj0QfboWIOku5DA"
}
],
"metatags": [
{
"creationdate": "D:20011001165911",
"producer": "Acrobat Distiller 4.0 for Windows",
"creator": "Windows NT 4.0",
"title": "A Visual Modality for the Augmentation of Paper",
"moddate": "D:20011010203501-07'00'",
"author": "David R. McGee , Misha Pavel, Adriana Adami, Guoping Wang, and Philip R. Cohen"
}
]
}
},
{
"kind": "customsearch#result",
"title": "Contents Preface #i 1 Introduction 1 I PreliHinRries 7 2 Overview 9 ...",
"htmlTitle": "Contents Preface #i 1 Introduction 1 I PreliHinRries 7 2 Overview 9 \u003cb\u003e...\u003c/b\u003e",
"link": "https://www.cs.utexas.edu/users/moore/publications/acl2-books/acs/excerpts.pdf",
"displayLink": "www.cs.utexas.edu",
"snippet": "W e omit the guard below , which allows the use of e q l below. ( defu R ...... th is \nnaiv e a r gum e n t assum e s th a t the n e w i te m is a n o d e in .W h a t if i t.",
"htmlSnippet": "W e omit the \u003cb\u003eguard\u003c/b\u003e below , which allows the use of e q l below. ( defu R ...... th is \u003cbr\u003e\nnaiv e a r \u003cb\u003egum\u003c/b\u003e e n t assum e s th a t the n e w i te m is a n o d e in .W h a t if i t.",
"mime": "application/pdf",
"fileFormat": "PDF/Adobe Acrobat",
"formattedUrl": "https://www.cs.utexas.edu/users/moore/publications/acl2.../excerpts.pdf",
"htmlFormattedUrl": "https://www.cs.utexas.edu/users/moore/publications/acl2.../excerpts.pdf",
"pagemap": {
"metatags": [
{
"producer": "Aladdin Ghostscript 6.01"
}
]
}
},
{
"kind": "customsearch#result",
"title": "end",
"htmlTitle": "end",
"link": "http://www.cs.columbia.edu/~sedwards/presentations/ccu2004.pdf",
"displayLink": "www.cs.columbia.edu",
"snippet": "Design a vending machine controller that dispenses gum once. ... dime have \nbeen inserted, and a single output, GUM, ...... to add guard variable or copy. ⇒.",
"htmlSnippet": "Design a vending machine controller that dispenses \u003cb\u003egum\u003c/b\u003e once. ... dime have \u003cbr\u003e\nbeen inserted, and a single output, \u003cb\u003eGUM\u003c/b\u003e, ...... to add \u003cb\u003eguard\u003c/b\u003e variable or copy. ⇒.",
"cacheId": "7oFO304KMz0J",
"mime": "application/pdf",
"fileFormat": "PDF/Adobe Acrobat",
"formattedUrl": "www.cs.columbia.edu/~sedwards/presentations/ccu2004.pdf",
"htmlFormattedUrl": "www.cs.columbia.edu/~sedwards/presentations/ccu2004.pdf",
"pagemap": {
"cse_image": [
{
"src": "x-raw-image:///54b64bebe16665867bf6c2965b03fa7116ef6b0137317ac8e3e64e314a0b600a"
}
],
"cse_thumbnail": [
{
"width": "211",
"height": "239",
"src": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSFwWtVT_MvYTqyJXpdjBC3M7oVVJXdHmyT9VE0WcaKqfC0wlnwuYLSB7Pj"
}
],
"metatags": [
{
"producer": "GNU Ghostscript 7.05"
}
]
}
}
]
}
As you can see gum guards according to this api has a correlation with squared numbers.
From here: enter link description here
Search the entire web.
This article applies only to free basic custom search engines. You can't set Google Site Search to search the entire web.
If you have a basic custom search engine, you can set it to search the entire web. Note that results may not match the results you'd get by searching on Google Web Search. If you do set your search engine to search the entire web, you won't be able to use on-demand indexing.
Convert a search engine to search the entire web:
On the Custom Search home page, click the search engine you want.
Click Setup, and then click the Basics tab.
Select Search the entire web but emphasize included sites.
In the Sites to search section, delete the site you entered during
the initial setup process.