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

  • SEARCH
  • Home
  • 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 4569554
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:14:09+00:00 2026-05-21T19:14:09+00:00

Say I have the following (phoney) feed result from YouTube using the Google Feed

  • 0

Say I have the following (phoney) feed result from YouTube using the Google Feed API.

{ "feed" : { "author" : "YouTube",
      "description" : "",
      "entries" : [ { "author" : "Foo",
            "categories" : [ "http://gdata.youtube.com/schemas/2007#video",
                "Entertainment",
                "golf",
                "resort"
              ],
            "content" : "Four friends are playing golf. Originally aired on 3/22/2011.",
            "contentSnippet" : "Four friends are still playing golf. Originally aired on ...",
            "link" : "http://www.linktoyoutubevid.com",
            "publishedDate" : "Thu, 24 Mar 2011 07:07:13 -0700",
            "title" : "Foobar"
          },

       .....more feed entries here.....

        ],
      "feedUrl" : "http://www.myyoutubefeed.com",
      "link" : "http://www.youtube.com",
      "title" : "YouTube Videos",
      "type" : "atom10"
    },
  "m" : "json",
  "status" : { "code" : 200 }
}

I want to save this feed result (keeping the JSON format) to a variable, but I first want to strip out elements like categories, content, and contentSnippet. I tried using .splice but kept getting this error: Error: feedResult.feed.entries[0].splice is not a function

Here’s part of my feed call:

feedUrl: opts.sourceUrl,
type: "video",
numEntries: 3,
onFeedLoad: function(feedResult) {
    //alert(feedResult);
    formatVids(feedResult);
    var test = feedResult.feed.entries[0].splice(1,3);
    //alert(test);

What’s the correct way to use .splice in this scenario? I could be getting confused as to whether I need to be splicing a JSON string or the JSON object. Is there a better solution?

Thanks!

  • 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-21T19:14:10+00:00Added an answer on May 21, 2026 at 7:14 pm

    Unfortunately Object keys are not equivalent to Array keys, in one very important aspect: Order is not preserved when dealing with Object keys.

    One way to accomplish what you are trying to do is:

    var resultFeed = feedResult.feed.entries.map( function(entry){
      delete entry.category;
      delete entry.content;
      delete entry.contentSnippet;
      return entry;
    })
    

    With regard to the IE compatability issue the following is from the MDC documentation on the subject.

    Compatibility

    map is a recent addition to the ECMA-262 standard; as such it may not be present in other implementations of the standard. You can work around this by inserting the following code at the beginning of your scripts, allowing use of map in implementations which do not natively support it. This algorithm is exactly the one specified in ECMA-262, 5th edition, assuming Object, TypeError, and Array have their original values and that fun.call evaluates to the original value of Function.prototype.call.

    if (!Array.prototype.map)
    {
      Array.prototype.map = function(fun /*, thisp */)
      {
        "use strict";
    
        if (this === void 0 || this === null)
          throw new TypeError();
    
        var t = Object(this);
        var len = t.length >>> 0;
        if (typeof fun !== "function")
          throw new TypeError();
    
        var res = new Array(len);
        var thisp = arguments[1];
        for (var i = 0; i < len; i++)
        {
          if (i in t)
            res[i] = fun.call(thisp, t[i], i, t);
        }
    
        return res;
      };
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have the following chef role: name test description role for test run_list
Let's say I have following function: int foo (int a) { return something; }
Lets say we have following models. class User(db.Model): username=db.StringProperty() avatar=db.ReferenceProperty() class User(db.Model): username=db.StringProperty() avatar=db.StringProperty()
Let's say I have following table like this <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0
Let's say we have following this: <p class=first>This is paragraph 1.</p> <p class=second>This is
Let's say we have following code: struct A{ virtual ~A(){} void f(){ p =
say I have the following <h3>This is my heading</h3> <p>This is my headingAnd this
Say I have the following data IEnumerable<IEnumerable<int>> items = new IEnumerable<int>[] { new int[]
Say I have the following code: <span>Hello world!</span> And the following CSS: span{ color:red;
Say I have the following DOM element in my piece of code: <div id=test>

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.