Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
1
10php
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yu Kimiduka
10php
Commits
004c4c8f
Commit
004c4c8f
authored
Jul 13, 2016
by
君塚 悠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
プログラム作成(rss.php,rss.xml:SimpleXml関数の学習)
parent
f241ac60
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
1 deletion
+55
-1
rss_output.php
php/php10/day06-1/rss_output.php
+1
-1
rss.php
php/php10/day06-3/rss.php
+45
-0
rss.xml
php/php10/day06-3/rss.xml
+9
-0
No files found.
php/php10/day06-1/rss_output.php
View file @
004c4c8f
...
...
@@ -10,7 +10,7 @@ $objRss = new RSSWriter("http://www.wings.msn.to/",
"dc:creator"
=>
"YAMADA, Yoshihiro <CQW15204@nifty.com>"
));
//
サマリ
情報の登録
//
新着
情報の登録
$objRss
->
setImage
(
"http://www.wings.msn.to/image/wings.jpg"
,
"サーバサイド技術の学び舎 - WINGS"
,
150
,
90
);
...
...
php/php10/day06-3/rss.php
0 → 100644
View file @
004c4c8f
<html>
<head>
<title>
RSSフィードの読み込み
</title>
</head>
<body>
<h1
style =
"background:#cccccc"
>
RSSフィールド読み込み
</h1>
<?php
//MagpieRSSフィードの読み込み RSSの読み込みに使用
reguire_once
(
"rss_fetch.inc"
);
//xmmlファイルを読み込み
$objXml
=
simplexml_load_file
(
"rss.xml"
);
//URLを取得し、解析していく
foreach
(
$objXml
->
site
as
$site
)
{
//siteの内容を読み込んでいく
$objRss
=
fetch_rss
(
$site
->
url
);
//EUC-JPに変換
mb_convert_valiables
(
"EUC-JP"
,
"auto"
,
$objRss
);
?>
<dl>
<dt
style =
"font-weight:bold;"
>
<?php
//タイトルが
if
(
!
is_null
(
$site
->
title
)
&&
$site
->
title
!=
""
)
{
print
(
mb_convert_encoding
(
$site
->
title
,
"EUC-JP"
,
"auto"
));
}
else
{
print
(
$objRss
->
channel
[
'title'
]);
}
?>
</dt>
<dd>
<ol>
<?php
foreach
(
$objRss
->
items
as
$item
)
{
?>
<li>
<a
href =
'
<?php
print
(
$item
[
'link'
]);
?>
'
>
<?php
print
(
$item
[
'title'
]);
?>
</a>
</li>
<?php
}
?>
</ol>
</dd>
</dl>
<hr
/>
<?php
}
?>
</body>
</html>
\ No newline at end of file
php/php10/day06-3/rss.xml
0 → 100644
View file @
004c4c8f
<?xml version="1.0" encoding="UTF-8"?>
<data>
<site>
<?title @IT新着情報?>
<?url http://atmarkit.co.jp/rss/rss2dc.xml?>
</site>
<site>
<?url http://www.wings.msn.to/redirect.php/-/A-12?>
</site></data>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment