atom-feed

Pulling <s:variant> from atom feed with simple pie

◇◆丶佛笑我妖孽 提交于 2019-12-02 04:39:41
问题 How can I get the title tag from the s:variant block below using simple pie? <s:variant> <id>product_variants-96590662</id> <title>Default Title</title> <s:price currency="GBP">10.00</s:price> <s:sku>002</s:sku> <s:grams>0</s:grams> </s:variant> I've tried the following to avail, and also 'variant' and just 's' $caption = $item->get_item_tags('http://www.w3.org/2005/Atom', 's:variant'); The feed in question is here (from shopify), and the docs on get_item_tags is here. 回答1: You can read the

Pulling <s:variant> from atom feed with simple pie

谁说胖子不能爱 提交于 2019-12-01 23:21:56
How can I get the title tag from the s:variant block below using simple pie? <s:variant> <id>product_variants-96590662</id> <title>Default Title</title> <s:price currency="GBP">10.00</s:price> <s:sku>002</s:sku> <s:grams>0</s:grams> </s:variant> I've tried the following to avail, and also 'variant' and just 's' $caption = $item->get_item_tags('http://www.w3.org/2005/Atom', 's:variant'); The feed in question is here (from shopify), and the docs on get_item_tags is here . You can read the xml namespace for s from the <feed> tag. <feed xmlns:s="http://jadedpixel.com/-/spec/shopify" xml:lang="en

How to set the default namespace using JAXB

廉价感情. 提交于 2019-12-01 18:58:40
I have a ATOM-XML representation of my data that is returned via a Spring MVC web service. I'm using JAXB to do the serialization, I have a number of namespaces but I want the default namespace set to Atom with no prefix. Here is what I have so far in package-info.java but the atom prefix is being set to ns3. @XmlSchema(namespace = com.mycomponay.foo.ATOM_NAMESPACE, xmlns = { @XmlNs(prefix = "foo", namespaceURI = com.mycomponay.foo.NAMESPACE_FOO), }, elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package com.mycompany.web; import javax.xml.bind.annotation.XmlNs; Also I

How to detect if a page is an RSS or ATOM feed

老子叫甜甜 提交于 2019-12-01 10:48:34
I'm currently building a new online Feed Reader in PHP. One of the features i'm working on is feed auto-discovery. If a user enters a website URL, the script will detect that its not a feed and look for the real feed URL by parsing the HTML for the proper tag. The problem is, the way im currently detecting if the URL is a feed or a website only works part of the time, and I know it can't be the best solution. Right now im taking the CURL response and running it through simplexml_load_string, if it can't parse it I treat it as a website. Here is the code. $xml = @simplexml_load_string( $site

Atom:link in RSS using Rome

荒凉一梦 提交于 2019-12-01 09:41:36
It is recommended to add to RSS 2.0. I am wondering if there is any Rome module available to add this tag? Like what they developed for content, media, etc . The blog post Adding Atom links to an RSS feed generated by ROME answers exactly that question: there is no build-in immediate support for Atom elements inside an RSS feed ... I’ve implemented an AtomContent class that holds a list of com.sun.syndication.feed.atom.Link but is easy extensible. The code is published as https://github.com/michael-simons/java-syndication . It's not a module, but you can use Channel.getForeignMarkup() if you

PHP Convert HTML Formatted Date

北慕城南 提交于 2019-12-01 07:56:56
问题 Published Date returned from Twitter Search API Atom Feed as 2008-11-03T21:30:06Z which needs to be converted to "X seconds/minutes/hours/days ago" for showing how long ago twitter messages were posted. Think this can be done with php date() function using DATE_ATOM value? 回答1: function time_since($your_timestamp) { $unix_timestamp = strtotime($your_timestamp); $seconds = time() - $unix_timestamp; $minutes = 0; $hours = 0; $days = 0; $weeks = 0; $months = 0; $years = 0; if ( $seconds == 0 )

ActionView::Template::Error (wrong number of arguments (1 for 0)) with atom_feed after upgrading to rails 3.1.0

依然范特西╮ 提交于 2019-12-01 06:05:24
I've just upgrade my rails application from the 3.0.7 version to the release candidate 3.1.0 and I got a strange error located in my atom feed builder: ActionView::Template::Error (wrong number of arguments (1 for 0)): 1: atom_feed do |feed| 2: feed.title("site name") 3: 4: for post in @posts app/views/posts/index.atom.builder:1:in `_app_views_posts_index_atom_builder___1517323884_2197638100' It seems to need an argument in the atom_feed method, but I tried to put something in it and it hasn't fixed the problem. It worked before the upgrade. Builder 3.0 is not compatible with fast_xs 0.8.0 on

How to display Atom/RSS feeds in browser with custom XSLT?

依然范特西╮ 提交于 2019-11-30 23:31:06
Back in about 2006, I wrote a nice XSLT that transformed my RSS feeds into custom HTML. That way if a user clicked from a browser it would display as a simple page rather than a bunch of junk XML. If that same URL was used in a feed reader it was handled properly and everything was slick. Now days, most browsers (IE, Firefox, Safari, Opera) seem to grab hold of the styles and won't let go. And Chrome just plain ignores the stylesheet transformation. Given that it has been several years, am I simply forgetting some detail? Didn't it used to just be this easy? <?xml version="1.0" encoding="utf-8

LINQ with ATOM feeds

血红的双手。 提交于 2019-11-30 17:43:29
问题 I am trying to create a simple Silverlight application that calls an ATOM feed and displays the article title and submit date. I found this very easy to do with RSS feeds and LINQ but I am stuck trying to do the same with an ATOM feed. The code below produces no errors but it also produced no results! What am I missing? Source ATOM feed: weblogs.asp.net/scottgu/atom.aspx Source Tutorial: www.switchonthecode.com/tutorials/silverlight-datagrid-the-basics Source code: using System; using System

Providing RSS and Atom feeds? Do we need both or has RSS won? [closed]

纵饮孤独 提交于 2019-11-30 11:20:22
I want to provide some RSS feed(s) for my site. Is it worth providing Atom feeds? or is Atom the more common feed? Is there a winner? BTW, this relates to programming because I'm required to program the feed which we will provide (or use some open source code, etc). Update So far it looks like peeps are saying Atom should be the way to go if I need to only spend time supporting one? Anyone else agree with these thoughts (and hopefully backed up by some stats??) Possible Solution While stumbling around the net for some RSS schema details, I was reading the RSS Wiki entry , and they say As of