Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 942039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:12:32+00:00 2026-05-15T22:12:32+00:00

This YQL statement ( execute in the YQL console ) picks out the name

  • 0

This YQL statement (execute in the YQL console) picks out the name and year of a film from the TMDB website.

select content from html where url="http://www.themoviedb.org/movie/27205" and xpath='//h3[@id="year"]|//h2[@id="title"]/a'

the results come back like this:

"results": {
  "a": "Inception",
  "h3": "(2010)"
}

Is there any easy way to have label the results as ‘name’ and ‘year’ rather than the html elements they were grabbed from?

Cheers!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T22:12:33+00:00Added an answer on May 15, 2026 at 10:12 pm

    Currently there is no easy way to quickly alias the returned labels. The best way at the moment is to create a custom data table which makes your query to TMDB and transforms the result (with Javascript, in an <execute> block) to whatever you want it to be.

    For example, I created a quick custom table for you which returns the results with your labels of choice (name and year). It also removes the parentheses from around the year. To give it a test run, use:

    use "store://github.com/tmdb-jp" as tmdb;
    select * from tmdb where movieid="27205"
    

    With the resulting JSON having the following structure (within the usual YQL response):

    "movie": {
     "title": "Inception",
     "year": "2010"
    }
    

    If you want to have a go at creating a data table yourself, or just see what’s involved, then the source is on my github. Also (it might be useful) you can query for multiple movies at once:

    use "store://github.com/tmdb-jp" as tmdb;
    select * from tmdb where movieid in ("27205","9802")
    

    P.S. The store:// URLs just mean that the data table is being stored in Yahoo!’s “cloud” for speed and reliability. You can of course use a normal http:// URL (e.g. by github one) instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing a very simple YQL statement: select * from xml where url=http://www.wowhead.com/item=50278&xml The
I'm using the YQL console to run the following query: select * from xml
how come this isn't working: $url = http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20xpath%3D%22%2F%2Fmeta%22%20and%20url%3D%22http://www.cnn.com%22&format=xml&diagnostics=false; $xml = (simplexml_load_file($url)) I get multiple
I'm using YQL to parse some web feeds, this one in particular. SELECT *
I tried this for pulling out the data from xml to php in session
I'm using this to retrieve RSS news feeds from Yahoo (JSON): select * from
I have this this feed from Yahoo (YQL) and need to output some info
I'm parsing a JSON object (from YQL) that includes some null values, like this:
In a request to YQL (select * from html where url=...) I got the
I'm trying to get the results from empire magazine website (Film Reviews (Popular Matches)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.