我已经在我的网站上安装了wordpress的 JSON api 。我可以使用wordpress和内容页面中的某些特定内容从网站上检索图片,并在带有JSON的 iOS应用中使用它。
以下是我收到的JSON数据:
<p><strong style=\"font-size: 13px;\">3rd March</strong></p>\n<p>Swell is 5 foot and cross shore, bitter in the cold wind. Maybe streedagh.</p>\n<p><span id=\"more-113\"></span></p>\n<p>High tide: 1703 3.6m <span style=\"color: #ff0000;\"> <a href=\"http://www.bundoransurfco.com/webcam/\"><strong>CLICK HERE FOR LIVE PEAK WEBCAM</strong></a></span></p>\n<p>Low Tide: 1041 0.8m</p>\n<p><b>3 day forecast to March 5th</b></p>\n<p>Good swell all weekend but the winds are changing. Keep in an eye for gaps in the wind.</p>\n\n\t\t<style type='text/css'>\n\t\t\t#gallery-1 {\n\t\t\t\tmargin: auto;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-item {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-top: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: 50%;\n\t\t\t}\n\t\t\t#gallery-1 img {\n\t\t\t\tborder: 2px solid #cfcfcf;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-caption {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t\t/* see gallery_shortcode() in wp-includes/media.php */\n\t\t</style>\n\t\t<div id='gallery-1' class='gallery galleryid-113 gallery-columns-2 gallery-size-medium'><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon landscape'>\n\t\t\t\t<a href='http://www.bundoransurfco.com/wp-content/uploads/2014/11/10406631_879797812043319_349665597571741998_n.jpg'><img width=\"300\" height=\"274\" src=\"http://www.bundoransurfco.com/wp-content/uploads/2014/11/10406631_879797812043319_349665597571741998_n-300x274.jpg\" class=\"attachment-medium colorbox-113 \" alt=\"10406631_879797812043319_349665597571741998_n\" /></a>\n\t\t\t</dt></dl>\n\t\t\t<br style='clear: both' />\n\t\t</div>\n\n<p><a href=\"http://www.bundoransurfco.com/webcam/\"> </a></p>\n<h1> Wind Charts</h1>\n<p><a href=\"http://www.windguru.cz/int/index.php?sc=103244\"><img class=\"size-thumbnail wp-image-747 alignleft\" title=\"wind guru\" src=\"http://www.bundoransurfco.com/wp-content/uploads/2010/12/wind-guru-67x68.jpg\" alt=\"\" width=\"67\" height=\"68\" /></a> <a href=\"http://www.xcweather.co.uk/\"><img class=\"alignnone size-thumbnail wp-image-749\" title=\"xcweathersmall\" src=\"http://www.bundoransurfco.com/wp-content/uploads/2010/12/xcweathersmall2-67x68.jpg\" alt=\"\" width=\"67\" height=\"68\" /></a> <a href=\"http://www.buoyweather.com/wxnav6.jsp?region=UK&program=nww3BW1&grb=nww3&latitude=55.0&longitude=-8.75&zone=0&units=e\"><img class=\"alignnone size-thumbnail wp-image-750\" title=\"buoy weather\" src=\"http://www.bundoransurfco.com/wp-content/uploads/2010/12/buoy-weather-67x68.jpg\" alt=\"\" width=\"67\" height=\"68\" /></a> <a href=\"http://www.windguru.cz/int/index.php?sc=103244\">Wind Guru</a> <a href=\"http://www.xcweather.co.uk/\">XC Weather</a> <a href=\"http://www.buoyweather.com/wxnav6.jsp?region=UK&program=nww3BW1&grb=nww3&latitude=55.0&longitude=-8.75&zone=0&units=e\">Buoy Weather</a></p>\n<h1>Swell Charts</h1>\n<p><a href=\"http://magicseaweed.com/Bundoran-Surf-Report/50/\"><img class=\"alignnone size-thumbnail wp-image-753\" title=\"msw logo\" src=\"http://www.bundoransurfco.com/wp-content/uploads/2010/12/msw-logo-67x43.jpg\" alt=\"\" width=\"75\" height=\"43\" /></a> <a href=\"http://magicseaweed.com/UK-Ireland-MSW-Surf-Charts/1/\"><img class=\"alignnone size-thumbnail wp-image-754\" title=\"magicseaweedwamchart\" src=\"http://www.bundoransurfco.com/wp-content/uploads/2010/12/magicseaweedwamchart1-67x68.png\" alt=\"\" width=\"67\" height=\"68\" /></a> <a href=\"http://www.marine.ie/Home/site-area/data-services/marine-forecasts/wave-forecasts\"><img class=\"alignnone wp-image-755 size-thumbnail\" title=\"marine institute irish bouy data\" src=\"http://www.bundoransurfco.com/wp-content/uploads/2010/12/marine-institute-irish-bouy-data-67x42.jpg\" alt=\"\" width=\"67\" height=\"42\" /></a> <a href=\"http://magicseaweed.com/Bundoran-Surf-Report/50/\">Magic Seaweed</a> <a href=\"http://magicseaweed.com/UK-Ireland-MSW-Surf-Charts/1/\">MSM WAM</a> <a href=\"http://www.marine.ie/Home/site-area/data-services/marine-forecasts/wave-forecasts\">Marine Institute</a></p>\n<h1>Pressure, Weather, Tides</h1>\n<p><a href=\"http://news.bbc.co.uk/weather/forecast/13000\"><img class=\"alignnone size-thumbnail wp-image-756\" title=\"bbc pressure\" src=\"http://www.bundoransurfco.com/wp-content/uploads/2010/12/bbc-pressure-67x68.jpg\" alt=\"\" width=\"67\" height=\"68\" /></a> <a href=\"http://www.met.ie/\"><img class=\"alignnone size-thumbnail wp-image-759\" title=\"met eireann\" src=\"http://www.bundoransurfco.com/wp-content/uploads/2010/12/met-eireann-67x68.jpg\" alt=\"\" width=\"67\" height=\"68\" /></a> <a href=\"http://news.bbc.co.uk/weather/forecast/13000\">BBC Pressure</a> <a href=\"http://www.met.ie/\">Met Eireann</a> <a href=\"http://www.irishtimes.com/weather/tides.html\">Irish Tide Tables</a></p>\n
所以在这个JSON数据中,我提供了我需要的一切,但是如何选择好的信息呢?我们可以查询吗? 我想获取这些数据(来自截图)
我该怎么做?
我还有一个名为&#34; excerpt&#34;在JSON数据中包含这些数据(只是我需要的文字,没有图片):<p>3rd March Swell is 5 foot and cross shore, bitter in the cold wind. Maybe streedagh. High tide: 1703 3.6m CLICK HERE FOR LIVE PEAK WEBCAM Low Tide: 1041 0.8m 3 day forecast to March 5th Good swell all weekend but the winds are changing. Keep in an eye for gaps in the wind. […]</p>\n
但是我可以删除像<p>
这样的HTML标记,并跳过日期之后的一行(例如我想到了#34} ; 1月,2月,3月......&#34; [阵列],跳过一条线?
在High Tide之前,跳过一条线。 在Low Tide之前,跳过一条线。 ...