Jump to content
Existing user? Sign In

Sign In



Sign Up

RSS Feed


Pax

Recommended Posts

May be used for reading certain forums within IPB, or other web/software.

 

import java.net.URL;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public class RSSFeed {

	/**
	 * @author: Pax M
	 */

	/**
	 * The URL that we want to read from
	 */
	public static String URL = "

 
	
		
This is the hidden content, please
"
; /** * Read the RSS * * @param read element * @param read tagName * @return element * @return tagName */ public static String read(String element, String tagName) { try { DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.parse(new URL(URL).openConnection() .getInputStream()); doc.getDocumentElement().normalize(); for (int temp = 0; temp < doc.getElementsByTagName(tagName) .getLength(); temp++) { Node nNode = doc.getElementsByTagName(tagName).item(temp); if (nNode.getNodeType() == Node.ELEMENT_NODE) { Element eElement = (Element) nNode; return eElement.getElementsByTagName(element).item(0) .getTextContent(); } } } catch (Exception e) { e.printStackTrace(); } return null; } }

 

Usage:

 

RSSFeed.read(element, tagName);

 

Edited by Pax
Link to comment
Share on other sites

  • 3 months later...
  • 2 years later...
  • 4 months later...
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Contact

[email protected]

astra.security

What is a RSPS?

A RSPS, also known as RuneScape private server, is an online game based on RuneScape, and controlled by independent individuals.

Popular RSPS Servers

Runewild Ikov RedemptionRSPS

Disclaimer

Runesuite is not affiliated with runescape, jagex in any way & exists solely for educational purposes.

×
×
  • Create New...