So, this is what I am trying to download - https://www.slader.com/textbook/9781337624183-calculus-9th-edition/
Looks fairly simple, I tried adding a few lines to "scan rules" to force it to download everything under it but for some reason, the entire process finishes under 10 seconds and it doesn't go further than just downloading the aforemention link itself.
For example, in addition to having https://www.slader.com/textbook/9781337624183-calculus-9th-edition/ itself, I would like to have all links originating from it, such as https://www.slader.com/textbook/9781337624183-calculus-9th-edition/311/ too.
Essentially, everything that starts with the first link above (including embedded pictures originating from other domains, but no external links.
As far as I know, adjusting a few settings and adding some rules to the "Scan Rules" section is supposed to do the trick, but I couldn't figure it out myself unfortunately.
In order to only copy links that are from that host and no other, to include the first link you submit you would need to setup scan rules.
On the menu page that you set the web address click the "Set options ..." button and then the Scan Rules tab. Next ensure your scan rules exclude all links, and then that they include the links from the source you want. And example of such a setup would be
+*.png +*.gif +*.jpg +*.jpeg +*.css +*.js -ad.doubleclick.net/* -mime:application/foobar
-*
+*[name].slader.com/*
This would essentially save all links originating from slader.com but would not store anything outside of that domain.
EDIT
If you only want links that begin with the link you typed in your scan rules would look similar to this:
+*.png +*.gif +*.jpg +*.jpeg +*.css +*.js -ad.doubleclick.net/* -mime:application/foobar
-*
+*[name].*[name]https://www.slader.com/textbook/9781337624183-calculus-9th-edition/*[name].*[name]/*
EDIT
You may not be able to get the other pages such as "Four Ways to Represent a Function" through HTTrack due to the way that specific sight has it's links structured. If you look at the source their links are posted like:
<tr data-url="/textbook/9781337624183-calculus-9th-edition/17/" class="exercise-group">
<td>1.1</td>
<td style="width: 360px;">Four Ways to Represent a Function</td>
<td style="width: 230px;">Exercises</td>
<td style="width: 74px;">p.17</td>
</tr>
As you can see they are using the data-url attribute to locate the next page utilizing a JS library to actually navigate the browser there. As this is not an anchor tag HTTrack doesn't know that it's suppose to follow it as it doesn't see it as a link.
Some alternatives would be to use something like Selenium or Scrapy to write a web-scraper with your own rules that would better understand it.
Related
I need to create a footer in a Liferay-project, that can be modified from the instance. I've been trying various things in my footer-code and instance, but haven't figured out how to do it.
Any content inside the footer can't be touched and in page edit mode, Liferay says "This area is defined by the theme. You can change the theme settings by clicking more in the Page Design Options panel on the sidebar". I didn't get any help from Page Design Options either. Is there a way to do this?
I found the answer after hours of work and searching and want to share it with everyone here. The working solution was found here, in one of the comments.
You need to write some code (I use Freemarker/ftl) and then configure the site pages a bit, but here's how it works:
Put a new setting inside liferay-look-and-feel.xml:
<settings>
<setting key="footer-article-id" value="" configurable="true" type="text"/>
</settings>
This will create a new configurable option in page options, allowing you to input the ID of the web content.
NOTE: <theme> might get underlined red "The content of element type "theme" must match". This still prints everything correctly, but the tags are given in a wrong order. Inside my <theme>, I have <template-extension>, <settings> and <portlet-decorator> in that order, which removes the error.
Assign a variable in init_custom.ftl (cleans up the footer-code):
<#assign footer_article_id = getterUtil.getString(themeDisplay.getThemeSetting("footer-article-id"))/>
And then add this to the footer-code, to create the spot, where the content is visible:
<#liferay_journal["journal-article"]
articleId=footer_article_id
groupId=page_group.groupId
/>
After this, everything should be ready code-wise.
Create a Web Content for your footer. In the creation screen, there's an ID on the panel on the right. Publish your content and grab the ID.
Finally, go to Site Builder --> Pages and click on configuration from the top bar (behind three dots). You should see the input field like in the first picture: That's where you add the ID.
Save the settings and your web content should now be in the footer.
Hope this helps!
I'm trying to create a chunk or a snippet a user can edit without touching the code. I thought it would be the best to include the content of a page since the pages use an editor. Can anyone tell me how I can accomplish this? Or tell me the best way to do it?
If I understand you correctly, you want to create, for example, a footer chunk with 3 editable regions.
I would do this by dedicating 3 resources for each editable region. Have the user make their changes via TinyMCE in these 3 resources (perhaps nest them in parent labled accordingly, eg: "Footer Columns"). Make sure they're hidden from menus so they don't come up by mistake.
Then use getResources within your chunk to display each. Eg:
<div class="footerchunk">
[[getResources?
&resources=`45,46,47`
&tpl=`footerColItem`
&depth=`0`
&limit=`3`
&includeContent=`1`
&showHidden=`0`
]]
</div>
Note that the resources in my example would correspond to the resources your using to allow the users to enter the text.
You would be required to build a footerColItem chunk, perhaps something like:
<div class="footercol">
[[+content]]
</div>
Note also the use of &showHidden=0
This is all from memory, so can't guarantee this will work straight away. Look at https://docs.modx.com/extras/revo/getresources for more info
I wish to add a new menu item/link (e.g. "Stack Overflow") at the end of the menu in the screenshot below.
The new link URL would end in the community_uuid e.g. http://example.stackoverflow.com/some-page#community_uuid
Is there any good documentation available to show how this is done?
Immediately I thought of three things:
1 - Custom CSS for a community, so you could somehow add/change or maybe create a landing spot for a dom manipulation event which adds it.
In order to change the CSS, You should look at:
http://infolib.lotus.com/resources/oneui/3.0/docPublic/components/menu.htm
It's the navbar role.
In a folder such as /local/con/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/conServerCell/Communities.ear/comm.web.war/nav/common/styles/orangeTheme/
2 -
You may also want to look at /local/con/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/conServerCell/LotusConnections-config/widgets-config.xml
specifically
you could add a StackOverflow widget, when loaded it automatically opens up a new window, and transfers the person back to the previous page. ... a little bit of a kluge...
3 - Look for /local/con/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/conServerCell/Communities.ear/comm.web.war/nav/templates/page.jsp
find the line
<div class="lotusMenu" id="lotusMenu" style="display:none;" role="navigation" aria-label="Main navigation"><div class="lotusBottomCorner"><div class="lotusInner">
<div id="lotusMenuTree"></div>
</div></div></div>
You could modify the very end to add some custom link for you.
Just some quick thoughts...
Can you give me here some code by which I can click on anchor label on a webpage. I want click on the "Configuration"label. These labels are used to navigate from one page to another page. Here is some part of the Web page view source.
<td class="tabtext-unsel"><nobr>Catalogs</nobr></td>
<td class="tabtext-sel"><nobr>Configuration</nobr></td>
After some discussion in comments i can suggest another answer:
Automation and Scripting Language
You may use this to navigate complicated pages, automate work in any application etc. It can copy almost any data and paste it to excel for example.
Maybe this will help you:
Youtube: MrExcel's Learn Excel #665 - Scraping Webpages
There is a technique called web scraping.
You may find many tutorials about web scraping, there are some tutorials for excel.
When a list item has an attachment, SharePoint automatically renders a paperclip image for that particular row, which indicates that the item has an attachment. Is there any way to change the image that is rendered?
The site is in a shared hosting environment, so I can't simply replace the image on the file system. Also, there are other lists that are part of the same site that should use the default image.
Is there any way to change the image that is rendered for items with an attachment on an individual list basis?
EDIT: Following is the HTML that is rendered:
<td class="ms-vb2">
<img align="absbottom" src="http://devsandbox/_layouts/images/attach.gif" alt="Attachment"/>
</td>
The only real way you'll be able to do this is to use jQuery (or some other javascript library). You'll need to locate the elements you want to update on the page and change the URL's
$('img[src*=attach.gif]').each(function() {
$(this).attr('src', '/path/to/new/image.png');
}
My jQuery may be a touch wrong but that should be near enough to give you an idea of what to do
Edit - The best way to have this down would be via a custom WebPart which renders the JavaScript. This way it can easily be dropped into any page you want
i don't know which element off the top, but I would look for it in one of the stylesheets and use SharePoint designer to do the replacement work for a specific list.
Use Firebug to inspect the element that you want to revert. This will tell you the css class and other properties used by that element. Then write your own class and add it to the core.css file or if you want, add it to the css for the Site/Site Collection through the MasterPages link in Site Settings.
EDIT
I used firebug to look at an image in SharePoint and here is how it is rendering.
<img id="img_1-2_" class="rpo-gif rpo-gif-2" border="0" style="padding: 0px;" alt="Expand/Collapse" src="/_layouts/images/minus.gif"/>
As you can see it is using a class and setting a src to '/_layouts/images/minus.gif'. Well you can go find that file in the 12Hive directory and then replace it with an image of your choice that has the same name.