Skip to content

Commit

Permalink
pageUrl to contain an end original link.
Browse files Browse the repository at this point in the history
For example, if input link is http://bit.ly/XXXX, than originaUrl will be http://example.com/YYYY, but not http://bit.ly/XXXX
  • Loading branch information
rkhmelyuk committed Nov 19, 2011
1 parent 8d512af commit d7e5290
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/opengraph/OpenGraph.java
Expand Up @@ -64,9 +64,7 @@ public OpenGraph()
public OpenGraph(String url, boolean ignoreSpecErrors) throws java.io.IOException, Exception {
this();
isImported = true;
// init the attribute storage

pageUrl = url;

// download the (X)HTML content, but only up to the closing head tag. We do not want to waste resources parsing irrelevant content
URL pageURL = new URL(url);
Expand Down Expand Up @@ -179,6 +177,9 @@ else if (metaElement.hasAttribute("name"))
if (finished) break;
}

// read the original page url
URL realURL = siteConnection.getURL();
pageUrl = realURL.toExternalForm();
}

/**
Expand Down

0 comments on commit d7e5290

Please sign in to comment.